What is wrong with this type of .aspx code?

前端 未结 1 426
粉色の甜心
粉色の甜心 2020-12-07 05:02

I\'m having one bear of a time trying to figure out why a legacy project won\'t compile for me; I get only one error, an \"Object reference not set\", which is usually strai

相关标签:
1条回答
  • 2020-12-07 05:50

    I found this written by the cat with the indecisive surname, which sounded promising, so I closed VS, deleted the two *.suo files, reopened VS ("As Administrator") and then the project, tried Build > Rebuild Web Site, and got:

    Error   1   compiler initialization failed unexpectedly: Project already has a reference to assembly System.Web.Extensions. A second reference to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Web.Extensions.dll' cannot be added. vbc : Fatal
    

    2-clicking the Error took me nowhere.

    I thought, What now? Where is a second reference to System.Web.Extensions.dll attempting to be added, and how can I prevent that?

    Meanwhile, the irritation of dealing with messages about TFS connections sent me on a detour down that path - to rid the project of all TFS vestiges. The answers here about deleting some files (*.vsssssssssccccc and such) and removing certain global sections from the .sln file not only cleared up that irritation, but also ended up, apparently, solving the other problems.

    So some combination of the following:

    Deleting the .suo files
    Cleaning out the TFS files and sections
    Running VS as Administrator
    

    ...got the project to a state where it actually finally runs! It seems like a mixture of magic and serendipity that these weird err msgs "just went away" as a result of these gyrations, but I guess I'll accept the fact that it at least finally works.

    Note, too (I don't know why or how this fits into what happened), that something in those tweaks I made caused the "WEBSITE" menu in VS to change to "PROJECT"

    UPDATE

    And today the menu has changed back, from PROJECT to WEBSITE, but it still builds and runs, so I guess I'll just scratch my head in consternation and blithely continue on.

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