Wrong FrameworkDir in Microsoft.Common.targets - by Admiral_Snyder

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 530175 Comments
Status Closed Workarounds
Type Bug Repros 3
Opened 2/2/2010 11:51:25 AM
Access Restriction Public


... in the final version of .net framework 4, this problem still isn't solved. instead, FrameworkDir is set to TargetFramework20DirectoryItem if $(FrameworkDir) is empty. I cannot see where $(FrameworkDir) is set initially, except for build scripts.
But even if it was nonempty, it should be set to TargetFramework40DirectoryItem, because .net framework 4 brings new binaries like regasm.

please correct this in the next version or correct me, if my assumption is wrong.

... Just installed the Release Candidate. the problem was not corrected.

the Property FrameworkDir in the "C:\windows\Microsoft.NET\Framework\v4.0.21006\Microsoft.Common.targets" file ist set to @(_TargetFramework20DirectoryItem).

this makes no sense if you want to develop for the 4.0 .net platform and use e.g. regasm as a prebuild-command, as i did.

Just don't forget to correct it in the final, and maybe notify it somewhere.
Sign in to post a comment.
Posted by johnw_at_abb on 8/3/2010 at 12:51 PM
After upgrading from vs2008 to vs2010 our msbuild file no longer worked. We use $(FrameworkDir) in several targets. This symbol has apparently changed. We tried several fixes and struggled to get a fixt that worked for both command line builds and interactive build using devenv.exe. After finding this post we added
<FrameworkDir>@(_TargetFramework20DirectoryItem)</FrameworkDir> to our Common.Targets file and were able to leave all the $(FrameworkDir) references as is. This workaround worked for both the command line build and interactive builds.

We have:
VS Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel

Installed Version: Professional

Posted by Microsoft on 6/21/2010 at 2:02 PM
We have fixed this issue in the RTM of the product.

I am resolving this issue as fixed.

Thanks for your help!

Chuck England
Visual Studio
Program Manager - MSBuild
Posted by Microsoft on 2/19/2010 at 4:23 PM
I noticed a typo in my response to you. If should say the $(Framework40Dir). Left out the parenthesis.

Unfortunately, with the RC (Release Candidate) just release, we cannot fix for this cycle. But, we have postponed so that we can look at fixing it in a future cycle.


Chuck England
Visual Studio Platform
Program Manager - MSBuild
Posted by Admiral_Snyder on 2/6/2010 at 2:00 PM

i just fixed the entry in the .targets file. worked fine.
using the Framwork40Dir-property doesn't work for me, nor does setting the properties manually, because the project is develloped using both VS2008 (usually) and VS2010 (on my computer).

I just wanted to make sure that the error is notified, to be fixed in the final.

I was very happy to read your feedback.

Thanks again,

Posted by Microsoft on 2/5/2010 at 2:38 PM
Thank you for your feedback. We will not be fixing this issue at this time due to where we are in the current development cycle and the bug bar we are using.

There are however two workarounds which you could use to get around this issue.

1) Use the $Framework40Dir) property, this property is set to the 4.0 framework directory.

2)If you still want or need to use FrameworkDir then you will need to set the property after the import of either the common or csharp / visual basic targets.

For example.
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Posted by Microsoft on 2/2/2010 at 8:45 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Thank you