Reputation: 127
I have a web application that is giving me type or namespace not found errors. The bizarre thing is that the errors are happening in an auto-generated file App_Web_XXXXXXXX.X.cs. How can I figure out which file is auto-generating this file so I can fix this issue?
Upvotes: 1
Views: 85
Reputation: 79
I hit this today using VS2013 and MVC4.
In my case I had added a new Model class, referenced it in a couple of places (a view and partial view) and then excluded the class and the referencing files from the solution / project. When everything was excluded I could not get the project to compile. I added the class and referencing files back in (e.g. "included" them) and then it built just fine.
I subsequently excluded the files that referenced the new class and it rebuilt successfully.
I then excluded the class and it failed again.
Then I included the class and commented all its code out and the compiler returned errors from the referencing files, which were excluded. Very strange. So apparently excluding files from the solution doesn't prevent them from being picked up during builds.
What ended up working for me was to simply make a backup of the files and delete them rather than excluding them.
HTH,
Andy
Upvotes: 1