2013-07-18 85 views
1

刚刚升级到Visual Studio 2012,连接到我的TFS解决方案,将所有项目从v4.0升级到v4.5。解决方案编译并运行正常。超。VS2010从vs2010升级后在错误列表中缺少编译器错误

现在我添加了新的代码,但编译器错误未列在错误列表输出窗口中。我只看到有关.dll文件未找到的错误。
例如Error 1 Could not copy the file "C:\SourceCode\<snip>Library.dll" because it was not found. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets

当然,那么它不能被发现,我把线:

thing bob = new thing(); 

成一类。
不幸的是,在编译期间不会报告这个错误。
甚至详细comiler输出显示CSC.EXE任务之后什么:

6>Task "Csc" 
6> C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe <snip> 
6>Done executing task "Csc". 

如果我在CMD窗口中运行CSC.EXE任务,你可以清楚地看到了异常:

Microsoft (R) Visual C# Compiler version 4.0.30319.17929 
for Microsoft (R) .NET Framework 4.5 
Copyright (C) Microsoft Corporation. All rights reserved. 
State\ConditionalAction.cs(16,13,16,18): error CS0246: The type or namespace name 'thing' could not be found (are you missing a using directive or an assembly reference?) 
State\ConditionalAction.cs(16,29,16,34): error CS0246: The type or namespace name 'thing' could not be found (are you missing a using directive or an assembly reference?) 

有任何人之前见过这个问题或有任何想法?

编辑更多的证据

看来,“硬”编译错误都被报告由垃圾的行移除分号,即给了我一个编译器错误:

thing bob = new thing()

Error 2 ; expected C:\\ConditionalAction.cs 16

的然而,错误的类型仍然不存在。
EDIT 2多的证据

看来,VS 2012是无法正确识别,该项目开始运行和调试MVC应用程序(F5)时,与缺失的类型错误。 我刚刚删除了违规代码,运行了应用程序,重新插入了违规代码,重新运行了应用程序,并且VS愉快地运行了以前编译的应用程序版本而没有投诉。

+1

Windows 7 Enterprise – Seb

+0

不是100%确定要问什么,但“Visual C++ 2012”是Help >>关于Microsoft Visual Studio下安装的产品之一。 – Seb

+0

@yve我试过以上无效,确保我以管理员身份明确运行所有四项安装,然后重新启动。有关信息,我正在运行Visual Studio Enterprise的x64版本。我可以提供哪些其他信息以帮助您? – Seb

回答

1

我在升级到visual studio professional 2012时遇到了视觉工作室的问题。

首先,检查基本面。

  1. 您使用的是计算机与管理权限用户? 我怀疑你是,但如果没有,你需要有管理权。

  2. 你是否检查过任何文件被防火墙阻止? 当我切换到完整版本的Avast时,我发现我必须禁用文件系统屏蔽当我尝试运行我的Visual Studio项目时,它喜欢删除我的可执行文件。

  3. 确保您在4.5框架中创建项目。

Visual Studio 4.5 Framework

我所做的,是我结束了在卸载与双方的Visual Studio下载相关的一切。如果你能够删除并保存你的项目文件,然后将它们带回。浏览所有程序文件,看看是否有任何隐藏在错误文件夹中的内容并检查您的C驱动器。

这就意味着下载和重新安装(鲜):

  1. Install Windows 7 Service Pack 1

  2. Visual C++ 2012 Redistributable Package (arm.exe, x64.exe and x86,exe)

  3. Microsoft .NET Framework 4.5

  4. Microsoft Visual Studio 2012 SDK

请从MSDN约Visual Studio 2012 update 3

Note Visual Studio and Team Foundation Server (TFS) installation mechanics are different. The Visual Studio update installs on top of whatever is already installed on the computer. The TFS update is a full layout that replaces whatever is installed on the computer. Before you try to apply the TFS update, make sure that you have a full backup of your current databases. If the TFS update installation fails, you will be unable to restart the update or roll back to the earlier version of TFS without performing a restore procedure.

去阅读这句话此页有关Visual Studio 2012 Update 3的更多信息。

这里也是有用的链接Configuring Programs for 64-Bit (Visual C++)

+0

@yve,我已经尝试了上述,但没有运气,但我放弃了希望之前的快速说明 - 当安装C++可再发行组件(第2点)时,是否需要只安装x64版本,因为我运行的是x64 Windows 7最终,还是全部三个?我推测只有x64。 – Seb

+0

@只是为了确认,我现在已经完成了您提到的步骤,安装了x86和x64 redist。没有成功。 – Seb