Missing targeting pack for “.NETFramework,Version=v4.0,Profile=Profile47”

强颜欢笑 提交于 2019-12-01 04:58:27

问题


I've been having some problems when trying to compile the portable version of FSharp.Core from the f# source code.

To help with this, I created some project files to be able to open it inside Visual Studio instead of having to use the following command:

msbuild fsharp-library-build.proj /p:TargetFramework=portable-net4+sl4+wp71+win8

When I open FSharp.Core.Portable.sln from here, I get this very weird error:

There is no such targeting pack for VS2012, it's supposed to come out of the box.


回答1:


I had this issue recently. It turned out that I was importing the wrong targets file at the bottom of the project.

To get it to work, I replaced it with this:

<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.Portable.FSharp.Targets" />




回答2:


ZachBray pointed me at the problem. (after I got a project that wouldn't work)

I compared it with a new Portable Class Library and the problems is solved.

For most C# PCL's it the following line will work:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />

(so at the end in the project file, replace the 'Import' element for this one or a newer one)



来源:https://stackoverflow.com/questions/14935479/missing-targeting-pack-for-netframework-version-v4-0-profile-profile47

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!