My asp.net site has to run on several client servers. It\'s working fine on a majority of them, but a couple have run into an error message on a few pages:
For some special cases you could get rid of this if you disable batch compilation in the Web.config file like this:
<system.web>
...
<compilation debug="true" targetFramework="4.0" batch="false" />
...
</system.web>
After compiling, you can change the value back to True or remove the "batch" attribute, and then rebuild successfully.
The above solutions have worked for me in the past, but not this time.
I finally found the cause: one of those server side tags (like <%# Eval("Something") %> ) from the attribute of a control on the aspx page.
I'd added it shortly before the problem appeared, and removing it made the problem go away. It was in a TemplateField on a GridView.
Bizarre, but that's what did the trick.
Attempt 1:
A similar question was asked a couple of months back and look at those answers.
Attempt 2:
Have you cleared the "Temporary ASP.Net Files" for the site, usually found at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files? There may be an old copy lingering around.
None of the solutions worked for me. The code that it is complaining about is this:
thisSession = ((SiteMasterPage)this.Master).foo;
I'm casting the page's generic master page to the specific master page which grants me access to the foo object on the page's master page which is a complex object with trivial user data.
If you want to know why I'm doing this, it's because so far it's the best solution. Requirements dictate that I cannot extend the page class, no session variables, or cookies, and it must be user specific data.
I don't have enough reputation to comment, so I have to reply in an answer. :(
Had this numerous times. The solution is to close and open Visual Studio.
In my case at least it seemed to hove something to do wit