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!

4

1 に答える 1

1

Peter の提案はおそらく正しいでしょう。削除されたクラスをまだ参照している中間/デバッグ オブジェクトがある可能性があります。ソリューションをきれいにしてみてください。

プレースホルダー

編集: また、ローカル Web サーバーも再起動する必要があるかもしれません。この場合、IIS Express:

ここに画像の説明を入力

MSDN によると、「ビルドをクリーンアップすると、すべての中間ファイルと出力ファイルが削除され、プロジェクト ファイルとコンポーネント ファイルのみが残ります。プロジェクト ファイルとコンポーネント ファイルから、中間ファイルと出力ファイルの新しいインスタンスを作成できます。

于 2013-08-16T21:18:07.107 に答える