本文介绍了为什么VisualStudio / Firefox从排除类中的代码给我一个YSOD?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的项目中排除了一个类(右键单击>从项目排除);该文件忠实地从解决方案资源管理器中消失。然而,当我运行的应用程序,它与YSODs排除文件中的错误。

如何告诉Visual Studio和/或Firefox(浏览器该应用程序是目前使用),当我从项目中排除* .cs类的时候,我确实是这么做的?


$ b

UPDATE



更类似上面的奇怪:

看起来,VS真的与cshtml文件中出现的语法组合混淆了。虽然选择了一行代码并混合了Ctrl + K,但C会对该行进行注释,有时这些注释看起来并没有被尊重。



(Wane Shorter打败Wax更长时间了),我遇到了页面编译和显示问题,但没有加载jQueryUI(元素在那里,但是.datepicker()的输入不是datepickering,输入变形通过一个自定义的插件也没有变形值得一h,更不用说一个霍勒。



事实证明,我已经注释了一行代码不被视为有已经被注释掉了;在我删除了它所需要的使用行之后,由于这个原因,它不会被编译!我得到了这个YSOD:
$ b $ p

编译错误

 描述:编译服务请求所需的资源时发生错误,请仔细阅读以下具体错误的详细信息并适当地修改源代码。

Comp iler错误消息:CS0103:名称'duckbillReporterUtils'在当前上下文中不存在

源错误:

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

正如您所看到的,问题已经被注释掉了!我不得不删除它来让项目编译并重新运行!

解决方案

Peter的建议很可能是正确的 - 中间/调试对象仍然引用已删除的类。尝试清理解决方案。



p>

编辑:也许你也需要重新启动你的本地网络服务器。在这种情况下,IIS Express:



:当您清理生成,所有中间和输出文件被删除,只留下项目和组件文件。从项目和组件文件中,可以建立中间文件和输出文件的新实例。


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!

解决方案

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

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

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.'

这篇关于为什么VisualStudio / Firefox从排除类中的代码给我一个YSOD?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 21:08