Reputation: 23
I have a web site where any new aspx pages throws a "Parser Error". It has existing pages, and I can change the html or the c# code in it, and the change will appear in the web page in the browser.
The error page gives a message of "Could not load type classname". I've tried adding several different pages in Visual Studio, and copying the pages to IIS, so the syntax of the page should be fine.
I;ve also made sure that the "Inherits" attribute has the correct class and the class exists. I'm completely stuck.
Upvotes: 2
Views: 2686
Reputation: 5779
One thing that popped to mind immediately is to make sure that the target version of the .NET Framework for your web site is the same as the one specified for the application pool in IIS in which the site is running.
Right-click on the web site in Visual Studio and check the "Target framework" setting. Make sure this matches the ".Net Framework version" setting in IIS.
Upvotes: 1
Reputation: 1786
Are you using any usercontrols? Is your project set up as a web Application project or website?
If you are developing a web application project and you copy a new file or add a page without using the add new by right clicking you may have some page files that lack their designer files.
If that is the case then I suggest right clicking any page missing the designer file and click "Convert To Application" Then rebuild your solution
Upvotes: 0
Reputation: 2341
Have a look at the Directive at the top of the page. Does it have a CodeBehind
attibute? If so change it to CodeFile
, and try the page in the browser again.
If that doesn't work, compare the top part of a non-working page and a working page. Would be a little easier if you could post the top parts of the page here.
Upvotes: 2