Compiler error message: CS0716: cannot be converted to static type "System. Web. SiteMap"
A problem encountered today, SiteMap. aspx. an error occurred after page compilation because :. when defining the page class in the CS class, the class name is SiteMap, and the static System. web. duplicate SiteMap name ,. the CS SiteMap class cannot be converted to static. An error is reported after compilation. This is true for MS. However, running the program directly does not cause errors. This is for Xiami ..
The program runs correctly. The compilation is successful, but an error occurs after the program is released. You can help me to see it. It has been depressing for several days.
Compilation Error
Note: An error occurs during compilation of resources required to provide services to this request. Check the following error details and modify the source code as appropriate.
Compiler error message: CS0716: cannot be converted to static type "System. Web. SiteMap"
Source error:
Line 120: public sitemap_aspx (){
Line 121: string [] dependencies;
Line 122: (SiteMap) (this). AppRelativeVirtualPath = "~ /SiteMap. aspx ";
Line 123: if (global: ASP. sitemap_aspx. initialized = false )){
Line 124: Global: Asp. sitemap_aspx. stringresource = This. readstringresource ();
Source File: C:/Windows/Microsoft. NET/framework/v2.0.50727/Temporary ASP. NET files/root/171989b1/c89df8ef/app_web_sitemap.aspx.cdcab7d2.jyacigby.0.cs row: 122
Solution: When the CS page of sitemap. aspx is being reviewed
Using system;
Using system. Data;
Using system. configuration;
Using system. collections;
Using system. Web;
Using system. Web. Security;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. Web. UI. webcontrols. webparts;
Using system. Web. UI. htmlcontrols;
Using system. text;
Using system. Collections. Generic;
Using Yuxiang. BLL;
Using Yuxiang. model;
Public partial class SiteMap: System. web. UI. page {// The class name here cannot be SiteMap. It may be the same as the system's SiteMap. I don't quite understand it. So I can change it to another name, And SiteMaps won't work either. For example, I can change it: siteMapcc,
Public partial class SiteMapcc: System. Web. UI. Page {//
Of course: SiteMap. modify the source view of aspx: <% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "SiteMap. aspx. cs "Inherits =" SiteMapcc "%>