Error generating POM - Microsoft.CSharp.targets not found

Mar 3, 2010 at 9:27 PM

When I create a new class library solution in visual studio 2008 and then attempt to generate pom I get error:  

The imported project E:\Microsoft.CSharp.targets was not found.  Confirm that the path specified in the import declaration is correct, and the file exists on disk.

 

Coordinator
Mar 3, 2010 at 9:51 PM

Do you have VS 2008 SP1 installed? I was experiencing this and found that installing it corrected the problem. The problem is that the Addin for some reason loads MSBuild 2.0.0.0 instead of MSBuild 3.5.0.0.

You can work around it by editing the csproj/vbproj file to set the correct location of that file.

Mar 4, 2010 at 3:55 AM

I am on SP 1.  Replacing $(MSBuildToolsPath) with C:\WINDOWS\Microsoft.NET\Framework\v3.5 does work and can be changed back to $(MSBuildToolsPath) after import. 

Coordinator
Mar 5, 2010 at 5:19 AM

Before reopening the original issue, can you provide some more info about your system? Do you have the .NET 3.5 SDK (or Windows 6.0 SDK) installed and ahead of .NET 2.0 SDK in your path that is used to start Visual Studio?

Mar 5, 2010 at 3:19 PM

 

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;
C:\WINDOWS\Microsoft.NET\Framework\v3.5;
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;
C:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;
C:\Program Files\Microsoft SDKs\Windows\v6.0\bin;
C:\WINDOWS\system32;
C:\WINDOWS;
Yes, this is how my path starts:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;
C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools;
C:\WINDOWS\Microsoft.NET\Framework\v3.5;
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;
C:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;
C:\Program Files\Microsoft SDKs\Windows\v6.0\bin;
C:\WINDOWS\system32;
C:\WINDOWS;
....

 

Coordinator
Mar 7, 2010 at 10:47 PM

Thanks. Do you have any versions of MSBuild in your GAC?

Mar 8, 2010 at 3:31 PM

Nope.  If I run msbulid -version from cli I get the following:

Microsoft (R) Build Engine Version 3.5.30729.1

[Microsoft .NET Framework, Version 2.0.50727.3603]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
3.5.30729.1

Microsoft (R) Build Engine Version 3.5.30729.1

[Microsoft .NET Framework, Version 2.0.50727.3603]

Copyright (C) Microsoft Corporation 2007. All rights reserved.

3.5.30729.1

 

Mar 8, 2010 at 4:24 PM

Actually I'm wrong both versions, 2.0 and 3.5, of Microsoft.Build.Engine are in the gac.  

Was having an issue running the projectimporter tests with resharper in visual studio, but mvn test from commandline passes which is kinda odd.

 

Mar 8, 2010 at 6:33 PM

I added another unit test for this in the project importer seems, it appears that the issue is that msbuild 2.0 is unable to read a visual studio 2008 project.  Works after I replace the msbuild reference with 3.5.

 

 

Coordinator
Mar 12, 2010 at 4:27 AM
Edited Mar 12, 2010 at 4:28 AM

yes, that's exactly the problem, but I'm not sure why it is in your GAC (neither are on my installation). Perhaps that led to the problem. You could use fuslogvw to analyse what is happening.

I'm not sure the patch you supplied is a good idea - won't that cause it to fail on VS 2005 only systems?

Mar 12, 2010 at 2:45 PM

Well the project is referencing Microsoft.Build.Engine.dll 2.0.0.0, so I'm not sure why I should expect it to be working?  3.5 build engine has an additional attribute called ToolsVersion in the csproj file, perhaps MSBuild 2.0 can parse a 2008 project providing its not using ToolsVersion 3.5 as I haven't tested that.  I did include an additional test project with the patch for VS 2008, does this test pass on your machine without the fix?

MSBuild is included with the .NET Framework 3.5 so its not necessary to have VS2008 and will still work with VS2005 projects (as proven by tests), but would require VS 2005 users to install .net framework 3.5.  

Just for reference here are the patches I currently have installed for VS 2008.  

 

Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1
Installed Edition: Professional
Microsoft Visual Basic 2008   91605-270-8910253-60275
Microsoft Visual Basic 2008
Microsoft Visual C# 2008   91605-270-8910253-60275
Microsoft Visual C# 2008
Microsoft Visual F#   91605-270-8910253-60275
Microsoft Visual F# for Visual Studio 2008
Microsoft Visual Studio 2008 Tools for Office   91605-270-8910253-60275
Microsoft Visual Studio 2008 Tools for Office
Microsoft Visual Studio Tools for Applications 2.0   91605-270-8910253-60275
Microsoft Visual Studio Tools for Applications 2.0
Microsoft Visual Web Developer 2008   91605-270-8910253-60275
Microsoft Visual Web Developer 2008
Gallio   Version 3.1 build 397
Gallio integration for Visual Studio
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB944899)   KB944899
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/944899.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB945282)   KB945282
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/945282.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946040)   KB946040
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946040.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946308)   KB946308
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946308.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946344)   KB946344
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946344.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946581)   KB946581
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946581.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947171)   KB947171
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947171.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947173)   KB947173
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947173.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947180)   KB947180
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947180.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947540)   KB947540
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947540.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947789)   KB947789
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947789.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB948127)   KB948127
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/948127.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB953256)   KB953256
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/953256.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB971092)   KB971092
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/971092.
Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1 (KB945140)   KB945140
This service pack is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/945140.
PowerCommands for Visual Studio 2008   1.0
A set of power commands for Visual Studio 2008
ReSharper 4.5   C# Edition build 4.5.1274.1 on 2009-07-21T19:01:06
ReSharper add-in for Microsoft Visual Studio. For more information about ReSharper, see the ReSharper website at http://www.jetbrains.com/resharper. Copyright © 2003–2010 JetBrains, Inc
Security Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB972222)   KB972222
This security update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this security update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/972222.
Security Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB973675)   KB973675
This security update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this security update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/973675.
Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB956453)   KB956453
This update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/956453.
Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB967143)   KB967143
This update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/967143.
Reference Path Addin
Written by Patrik Svensson
psvensson82@gmail.com
http://www.firstdrafthell.net

Microsoft Visual Studio 2008

Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1
Installed Edition: Professional
Microsoft Visual Basic 2008   91605-270-8910253-60275
Microsoft Visual Basic 2008
Microsoft Visual C# 2008   91605-270-8910253-60275
Microsoft Visual C# 2008
Microsoft Visual F#   91605-270-8910253-60275
Microsoft Visual F# for Visual Studio 2008
Microsoft Visual Studio 2008 Tools for Office   91605-270-8910253-60275
Microsoft Visual Studio 2008 Tools for Office
Microsoft Visual Studio Tools for Applications 2.0   91605-270-8910253-60275
Microsoft Visual Studio Tools for Applications 2.0
Microsoft Visual Web Developer 2008   91605-270-8910253-60275
Microsoft Visual Web Developer 2008
Gallio   Version 3.1 build 397
Gallio integration for Visual Studio
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB944899)   KB944899
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/944899.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB945282)   KB945282
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/945282.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946040)   KB946040
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946040.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946308)   KB946308
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946308.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946344)   KB946344
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946344.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946581)   KB946581
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/946581.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947171)   KB947171
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947171.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947173)   KB947173
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947173.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947180)   KB947180
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947180.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947540)   KB947540
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947540.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947789)   KB947789
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/947789.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB948127)   KB948127
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/948127.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB953256)   KB953256
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/953256.
Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB971092)   KB971092
This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this hotfix will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/971092.
Microsoft Visual Studio 2008 Professional Edition - ENU Service Pack 1 (KB945140)   KB945140
This service pack is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/945140.
PowerCommands for Visual Studio 2008   1.0
A set of power commands for Visual Studio 2008
ReSharper 4.5   C# Edition build 4.5.1274.1 on 2009-07-21T19:01:06
ReSharper add-in for Microsoft Visual Studio. For more information about ReSharper, see the ReSharper website at http://www.jetbrains.com/resharper. Copyright © 2003–2010 JetBrains, Inc
Security Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB972222)   KB972222
This security update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this security update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/972222.
Security Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB973675)   KB973675
This security update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this security update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/973675.
Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB956453)   KB956453
This update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/956453.
Update for Microsoft Visual Studio 2008 Professional Edition - ENU (KB967143)   KB967143
This update is for Microsoft Visual Studio 2008 Professional Edition - ENU.
If you later install a more recent service pack, this update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/967143.

 

Coordinator
Mar 14, 2010 at 11:36 PM
kurtharriger wrote:

Well the project is referencing Microsoft.Build.Engine.dll 2.0.0.0, so I'm not sure why I should expect it to be working?  

That's what I thought initially too, but as I checked it with fuslogvw I found that it was loading the correct version from what VS was already using after I installed the service pack. Unfortunately I didn't write down more details at the time.

kurtharriger wrote:

3.5 build engine has an additional attribute called ToolsVersion in the csproj file, perhaps MSBuild 2.0 can parse a 2008 project providing its not using ToolsVersion 3.5 as I haven't tested that.  I did include an additional test project with the patch for VS 2008, does this test pass on your machine without the fix?

I'll have to check this again - I have multiple VMs (VS 2005 only, VS 2008 only, and one with both) to verify certain scenarios.

kurtharriger wrote:

MSBuild is included with the .NET Framework 3.5 so its not necessary to have VS2008 and will still work with VS2005 projects (as proven by tests), but would require VS 2005 users to install .net framework 3.5.  

Perhaps, though I'd need to confirm that actually worked. It does seem like a fairly burdensome requirement though - and what will happen when we want to support VS 2010? (assuming it bumps msbuild again, I haven't checked).

If there's no way for the Add-in to declare it uses the same version of MSBuild as the host application, then we probably need to distribute different versions for each, though I really hope that isn't the case.