双击 Visual Studio 2008 编译错误不会将我带到源文件
今天,我在 Visual Studio 2008 中编译了 Telerik RadControls ASP.NET AJAX“Live Demos”项目(我上周编译了几次并成功运行)。我对解决方案做了一些独特的更改,因为我们公司不使用 Visual Studio 2010 , 然而。请参阅下面的链接了解我所做的更改。
Telerik“实时演示”解决方案 - 连接字符串和连接字符串数据库设置
当我尝试编译它时,我首先遇到了三个错误,如下所示的编译 #1 错误。当我双击这些错误时,它不会将我带到源文件。 ???然后,我故意更改了随机文件中的一些代码以导致第四个编译错误,这样我就可以看到编译错误中通常填充哪些列。这是我的编译#2 错误。然后我修复了我故意提出的问题,并再次重新编译,并得到了编译 #3 错误。请注意,即使行号相同,也会出现轻微的错误视觉差异。同样,在#3 错误中,当我双击它们时,它不会将我带到源文件。我将尝试退出 Visual Studio 2008 并返回...也许这是 Visual Studio 周末 3 天保持打开状态的内存问题。如果这个问题解决了,我会将其作为答案发布,我们将其称为微软的侥幸。
仅供参考:“重新编译”的意思是“重建解决方案”
编译 #1 错误:
编译 #2 错误:
编译 #3错误:
Today, I compiled the Telerik RadControls ASP.NET AJAX "Live Demos" project (which I compiled several times last week and worked) in Visual Studio 2008. I made some unique changes to the solution because our company doesn't use Visual Studio 2010, yet. See the link below for the changes I made.
Telerik "Live Demos" solution - connection strings & database setup
When I tried to compile it, I first got three errors that are shown below under compilation #1 errors. When I double click those errors, it doesn't take me to the source file. ??? I then purposely changed some code in a random file to cause a 4th compilation error so I could see what columns are normally populated in a compilation error. That's my compilation #2 errors. Then I fixed that problem I purposely put in, and recompiled again, and got the compilation #3 errors. Notice the slight error visual differences even though they are the same line numbers. Again, in the #3 errors, when I double click them, it doesn't take me to the source files. I'll try getting out of Visual Studio 2008 and going back in... perhaps this is a memory issue with Visual Studio left open untouched for 3 days over the weekend. If that solves, I'll post that as the answer, and we'll call it a Microsoft fluke.
FYI: "recompiled" meaning "Rebuild Solution"
Compilation #1 errors:
Compilation #2 errors:
Compilation #3 errors:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我做了一些不该做的改变。找到了答案。
http://www.telerik.com/community/forums /aspnet/grid/column-grouping-question.aspx
================
另一个可能导致此问题的问题是,如果您为 ASP.NET 存储了临时文件网络应用程序 项目。退出解决方案,删除下面的文件夹,然后返回项目,然后重新编译/重建解决方案。这不是我的问题,但我确实看到临时文件可能会导致此问题。这基本上就是“Compilation #3 错误”屏幕截图中路径的来源。
C:\Windws\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\solution_folder_to_delete
=================
我的问题是我从代码中删除了命名空间后面的文件(.aspx.cs 文件),然后从源文件(.aspx 文件)的“继承”属性中删除命名空间。当我尝试在新的独立 Web 应用程序项目中隔离编辑器控件时,我这样做了。
损坏的代码:
....
工作代码:
...
I made some changes I shouldn't have. Found the answer.
http://www.telerik.com/community/forums/aspnet/grid/column-grouping-question.aspx
================
Another issue that can cause this is if you have temporary files stored for your ASP.NET web application project. Exit solution, delete the folder below, and go back into the project, and recompile/rebuild solution. That wasn't my issue, but I did see that temporary files can cause this. That's essentially where the paths are coming from in the "Compilation #3 errors" screen shot.
C:\Windws\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\solution_folder_to_delete
=================
My issue was that I removed the namespace from the code behind file (.aspx.cs file), and then removed the namespace from my "inherits" attribute on the source file (.aspx file). I did this when I tried to isolate the Editor control in a new stand alone web application project.
Broken code:
....
Working code:
...
根据 MacGyver 的建议,您可以转到位置 [C:\Windws\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\solution_folder_to_delete]。您必须使用任何文本编辑器手动打开每个扩展名为 .out 的文件。 .out 文件将显示文件名>列/行号。和错误/警告:就我而言,它显示以下内容:
D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE> “C:\WINDOWS\Microsoft
Microsoft (R) Visual C# 2008 编译器版本 3.5.30729.1,
适用于 Microsoft (R) .NET Framework 版本 3.5
版权所有 (C) Microsoft Corporation。保留所有权利。d
:\Project2015\Nt.aspx.cs (122,26):警告CS0168:声明了变量“ex”但从未使用过
d:\Project2015\Nt.aspx.cs(795,65): 错误 CS1002: ;
As suggested by MacGyver, you can go to the location [C:\Windws\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\solution_folder_to_delete]. You have to manually open each and every file with extension .out with any text editor. The .out files will show file name>col/row no. and error/warning: In my case it showed following:
D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE> "C:\WINDOWS\Microsoft
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
d:\Project2015\Nt.aspx.cs(122,26): warning CS0168: The variable 'ex' is declared but never used
d:\Project2015\Nt.aspx.cs(795,65): error CS1002: ; expected