Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS looking for .cs file in compiled .net site

Tags:

asp.net

iis

I am building my first ASP.Net web application project in VS2010. The site has a master page which all the content pages use.

I have published it to a local Windows 2008 R2 server running IIS 7.5 - so other members of the team can have a look.

I published it using 'File System' to a directory on the server. If I look in the directory on the server, all I see are .aspx files and a few dlls - which is what I would expect.

If I go into IIS and try to browse the web application (or open a browser on my local box and go to http://myserver/Contacts - I get a Server Error - 'the file Contacts/MasterPage1.master.cs' does not exist.

I don't understand - why is IIS looking for a .cs file when, in a web application project - all the .cs files are compiled into a dll?

like image 679
Martin Smellworse Avatar asked Nov 09 '11 08:11

Martin Smellworse


1 Answers

Check few things:

  • Check if you are you referring to master page type using CodeFile="..." or CodeBehind="..." attributes. If you are using CodeFile change to CodeBehind, or even better right click on your project and click Convert to Web project

  • Try adding namespace when referring to master page ( Inherits="Project.MasterPage" )

like image 128
Nikola Radosavljević Avatar answered Oct 29 '22 20:10

Nikola Radosavljević