Seb
Seb

Reputation: 179

VS2012 missing compiler errors in error list after upgrade from vs2010

Just upgraded to Visual Studio 2012, connected to my TFS solution, upgraded all the projects from v4.0 to v4.5. Solution compiles and runs fine. Super.

Now I'm adding new code but compiler errors are not listed in the Error List output window. I only see errors related to .dll files not being found.
e.g. 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

Well of course it can't be found, I put the line:

thing bob = new thing();

into a class.
Unfortunately this error is not reported during compilation.
Even the detailed comiler output shows nothing after the csc.exe task:

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

If I run the csc.exe task in a cmd window you can clearly see the exception:

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?)

Has anyone seen this problem before or have any ideas?

EDIT more evidence

It seems that 'hard' compile errors are being reported i.e. by removing the semi-colon from the line of rubbish gives me a compiler error:

thing bob = new thing()

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

The error to do with the missing type, however, is still not present.
EDIT 2 more evidence

It appears that VS 2012 is unable to correctly identify that the project has an error with the missing type when starting to run and debug the MVC app (F5). I just removed the offending code, ran the app, re-inserted the offending code, re-ran the app and VS merrily ran the previously-compiled version of the application without complaint.

Upvotes: 1

Views: 945

Answers (1)

user3956566
user3956566

Reputation:

I have had problems with visual studio, when upgrading to visual studio professional 2012.

Firstly, checking fundamentals.

  1. Are you using the computer as a user with Administrative rights? I suspect you are, but if not, you need to have administrative rights.

  2. Have you checked if any files are being blocked by your firewall? When I switched to the full version of Avast I find I have to disable the File System Shield It loves to remove my executable files when I try to run my visual studio projects.

  3. Ensure you are creating your projects in 4.5 Framework.

Visual Studio 4.5 Framework

What I did, was I ended up uninstalling EVERYTHING that was associated with both Visual Studio downloads. If you are able to remove and save your project files elsewhere and then bring them back. Go through all your program files to see if there is anything hidden in the wrong folder and check your C drive.

Which meant downloading and reinstalling (fresh):

  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

Please read this quote from MSDN about 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.

Go to this page for more information about the Visual Studio 2012 Update 3.

Here is also useful link Configuring Programs for 64-Bit (Visual C++).

Upvotes: 1

Related Questions