Search code examples
c#asp.netvisual-studio-2012asmx

The file 'blahblah.aspx' has not been pre-compiled, and cannot be requested


Yes I know, this question has been asked loads of times already.

But this isn't quite the same. Actually I think the error message is accurate!

Normally when you view a published ASPX file, you just see "This is a marker file generated by the precompilation tool, and should not be deleted!".

In my case, after building and publishing, when I view the published pages I see the full source code.

I'm using a newly installed copy of VS2012 so there's obviously something not quite right.

Any suggestions?

Thanks :)


Solution

  • Normally when you view a published ASPX file, you just see "This is a marker file generated by the precompilation tool, and should not be deleted!".

    Well, not really "normally" - you have to set that explicitly.

    Usual way - open Visual Studio, right-click project, "Publish", select profile

    Check the profile settings, or if necessary, create a new profile and (re)set to what you want.

    Screen shot of settings where you can pre-compile, make "updatable" or not (fully compiled, where you see the note you referred to above), etc.

    As shown below, the "normal" (default) settings is "updatable". Uncheck == everything is compiled - even (cs/vb)html, aspx, etc. (no source viewable in files)

    publish profile settings

    Hth...