Wednesday, December 4, 2013

Recently converted an ASP.NET Web Site project to a Web Application project...

...because I really need to use shared/common sources for 3 inter-related projects and you need a Web Application to do it (because Web Site projects do not let you link to source files, just copy.)

Anywho - I converted, built, tested, deployed, crashed.  Turned on detailed errors, zilch.  Enabled .NET error page information.  Bingo, "Default.aspx.cs could not be found."  What?

I FTP in, look at the directory structure and see that the bin folder does contain the DLL it should.  Spend a half hour wondering what exotic setting I'd forgotten to configure.  Cursed Microsoft for a little bit.

Suddenly I remembered something rather important.  When you're using a pre-compiled version of your project (as a Web Application generally is), you don't use the CodeFile attribute in your Default.aspx html code.  You use CodeBehind.

CodeFile instructs the webserver serving the page to use the JIT compiler.  CodeBehind instructs the compiler on your dev box where to find the class it needs to shove into the DLL.

So, yet again, it was all my #F$()ing fault.  Sigh...

No comments:

Post a Comment