2013-07-18 105 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