EXHIBIT 5 Opinion of Shumaker Williams, P.C. SHUMAKER WILLIAMS, P.C. 3425 SIMPSON FERRY ROAD CAMP HILL, PENNSYLVANIA 17011 (717) 763-1121 August 19, 1998 Larry J. Miller, President CODORUS VALLEY BANCORP, INC. P.O. Box 2887 York, PA 17405 Re: Codorus Valley Bancorp, Inc. (the "Corporation") Registration Statement Form S-8 Our File No. 676-98 Dear Mr. Miller: We have acted as Special Corporate Counsel to the Corporation in connection with preparation of the Corporation's Registration Statement on Form S-8 relating to the Corporation's 1998 Independent Directors' Stock Option Plan (the "Plan"). In connection with this matter, we, as counsel to the Corporation, have reviewed the following: 1. the Pennsylvania Business Corporation Law of 1988, as amended; 2. the Corporation's Articles of Incorporation; 3. the Corporation's By-Laws; 4. Resolutions adopted by the Corporation's Board of Directors on May 19, 1998 and June 23, 1998; and 5. the Plan. Based upon such review, it is our opinion that the Corporation's common stock, $2.50 par value, (the "Common Stock") issuable under the Plan, when and as issued in accordance with the provisions of the Plan, will be duly and validly issued, fully paid and nonassessable. In giving the foregoing opinion, we have assumed that the Corporation will have, at the time of the issuance of Common Stock under the Plan, a sufficient number of authorized shares available for issue. Larry J. Miller, President CODORUS VALLEY BANCORP, INC. August 19, 1998 Page 2 We hereby consent to the use of this opinion as an exhibit to the Corporation's Registration Statement on Form S-8. Very truly yours, B. Tyler Lincoln -------------------- By B. Tyler Lincoln BTL/db:84657