ASP.NET Page says I need to reference an assembly that does not exist!

前端 未结 5 791
故里飘歌
故里飘歌 2021-01-04 10:59

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:

相关标签:
5条回答
  • 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.

    0 讨论(0)
  • 2021-01-04 11:13

    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.

    0 讨论(0)
  • 2021-01-04 11:18

    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.

    0 讨论(0)
  • 2021-01-04 11:21

    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. :(

    0 讨论(0)
  • 2021-01-04 11:27

    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

    0 讨论(0)
提交回复
热议问题