如果我尝试使用此命令构建Visual Studio Project文件,我的Win10命令提示符上有MSBUILD版本14.0.25420.1,
msbuild .\folder1\WxsGenerators.sln
我在计算机上构建一个错误,我在计算机上遇到了一个错误
BUILD FAILED
D:\Dev\Views\YY261307_main_sv\microsoft\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.targets(40,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly Microso
ft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxx. Could not load file or assembly 'Microsoft.Build.CppTasks.Common, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=xxx' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, th
at the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\path\TomtecWxs.vcxproj]
,我已经安装了Visual Studio 2015和Visual Studio 2019。我需要弄清楚如何修复此错误并构建.sln文件,我在此处找到了一个类似的错误:
在接受的答案中,我尝试运行NPM命令但是无法做到,其他解决方案在与您的exe(如果还没有的话)中的同一dir中创建.config文件,该文件包含MSBUILD汇编的绑定重定向
我不确定如何如何 我有
什么方法可以更好地理解 /修复此“ setEnv”任务无法从汇编microso ft.build.cpptasks.common < / code>错误中加载?谢谢
I have msbuild version 14.0.25420.1 on my win10 command prompt computer, If I try to build a visual studio project file with this command:
msbuild .\folder1\WxsGenerators.sln
I get an error
BUILD FAILED
D:\Dev\Views\YY261307_main_sv\microsoft\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.targets(40,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly Microso
ft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxx. Could not load file or assembly 'Microsoft.Build.CppTasks.Common, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=xxx' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, th
at the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [D:\path\TomtecWxs.vcxproj]
On my machine I have visual studio 2015 and visual studio 2019 installed. I need to figure out how to fix this error and build the .sln file, I've found a similar error posted here:
Error MSB4062: The "SetEnv" task could not be loaded from the assembly
In the accepted answer, I tried to run the npm commands but was unable to do so, the other solution create .config file in the same dir as your exe (if you don't have it already) containing binding redirection of msbuild assemblies
I am not sure how to do
Is there any way I can understand better / fix this "SetEnv" task could not be loaded from the assembly Microso ft.Build.CppTasks.Common
error? Thanks
发布评论
评论(1)
根据您的描述,您会发现
您可以查看
c:\ program Files(x86)\ Microsoft Visual Studio \ 2019 \ community \ community \ msbuild \ current \ current \ current \ bin \ msbuild.exe.exe.exe 。
According to your description you find the solution but don’t know how to bind redirect msbuild assemblies in your porject.
I can give you some suggestions about how to do that.
You can create an app.config in your project folder to bind Redirects such as:
You can look at
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe.config
and copy necessary blocks to your app.config in project folder.