1

I excluded a class from my project (right-click > "Exclude from Project"); the file dutifully vanished from the Solution Explorer. Yet, when I run the app, it YSODs with an error in that excluded file.

How do I tell Visual Studio and/or Firefox (the browser the app is currently using) that I really meant it when I excluded the *.cs class from the project?

UPDATE

More strangeness similar to the above:

It seems that VS really gets confused with the combination of syntaxes occurring in a cshtml file. Although selecting a line of code and mashing Ctrl+K, C will comment the line, sometimes the comments don't seem to be respected.

To make a long story shorter (Wane Shorter beats out Wax Longer this time around), I was having problems with a page compiling and displaying but not loading jQueryUI (the elements were there, but the inputs that had been .datepicker()ed were not datepickering, and the inputs morphed via a custom plugin were also not morphing worth a hoot, let alone a holler.

It turns out that a line of code I had commented out was not seen as having been commented out; after I deleted the "using" line it needed, it wouldn't compile for that reason! I got this YSOD:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'duckbillReporterUtils' does not exist in the current context

Source Error:  

Line 58:             });
Line 59: 
Line 60:             //var platypiArray = '@duckbillReporterUtils.callingAllPlatypi()';

As you can see, the problem is a commented out line! I had to remove it to get the project to compile and run again!

Tunaki
  • 132,869
  • 46
  • 340
  • 423
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

1 Answers1

1

Peter's suggestion is likely right - you may have an intermediate/debug object that still references the deleted class. Try to clean the solution.

Placeholder

Edit: And maybe you'll need to restart your local webserver as well. In this case, IIS Express:

enter image description here

According to MSDN: 'When you clean a build, all intermediate and output files are deleted, leaving only the project and component files. From the project and component files, new instances of the intermediate and output files can then be built.'

OnoSendai
  • 3,960
  • 2
  • 22
  • 46
  • I cleaned it so much I'm starting to get carpal tunnel syndrome, and am wearing the chrome off Visual Studio. – B. Clay Shannon-B. Crow Raven Aug 16 '13 at 21:28
  • 1
    You poor thing =) Ok, another possibility is that your webserver may be still referencing the old version. You can try restarting it. – OnoSendai Aug 16 '13 at 21:30
  • Restarting the built-in "junior" server requires what - restarting VS? Restarting the machine? Or something more nefarious? – B. Clay Shannon-B. Crow Raven Aug 16 '13 at 21:36
  • Complete reformat. Nonono, just kidding! Just stopping the application must be fine; you may exit it as well, Visual Studio will launch it again. – OnoSendai Aug 16 '13 at 21:44
  • I didn't see any .DLL connected with the excluded file, but I deleted the file itself (the *.cs file), and that finally stopped the madness. Well, that's my optimism speaking; to be more realistic, it suspended the madness until the next time mania rears its butt-ugly head. – B. Clay Shannon-B. Crow Raven Aug 16 '13 at 21:48
  • And it will - Oh yes, it surely will. But nice to know it was warded off at least temporarily. – OnoSendai Aug 16 '13 at 21:50