Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 使用MSBuild生成InstallShield项目-错误MSB4062_Visual Studio_Msbuild_Installshield - Fatal编程技术网

Visual studio 使用MSBuild生成InstallShield项目-错误MSB4062

Visual studio 使用MSBuild生成InstallShield项目-错误MSB4062,visual-studio,msbuild,installshield,Visual Studio,Msbuild,Installshield,我使用Visual Studio 2012,我刚刚将部署工具从NSIS切换到InstallShield。我为InstallShield安装程序的解决方案添加了新项目。当我在VisualStudio(IDE)中构建时,我没有错误,没有警告,我很高兴 现在,我想要一个脚本,它可以在不启动IDE的情况下构建完整的解决方案。但是当我在命令行中运行MSBuild时,就像这样 MSBuild MySolution.sln /t:Build /p:Configuration=Release 我得到以下错误M

我使用Visual Studio 2012,我刚刚将部署工具从NSIS切换到InstallShield。我为InstallShield安装程序的解决方案添加了新项目。当我在VisualStudio(IDE)中构建时,我没有错误,没有警告,我很高兴

现在,我想要一个脚本,它可以在不启动IDE的情况下构建完整的解决方案。但是当我在命令行中运行MSBuild时,就像这样

MSBuild MySolution.sln /t:Build /p:Configuration=Release
我得到以下错误MSB4062

C:\Program Files (x86)\MSBuild\InstallShield\2012SpringLimited\InstallShield.targets(21,3): error MSB4062: The "Microsoft.Build.Tasks.AssignProjectConfiguration" task could not be loaded from the assembly Microsoft.Build.Tasks.v3.5. Could not load file or assembly 'Microsoft.Build.Tasks.v3.5' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
C:\Program Files(x86)\MSBuild\InstallShield\2012SpringLimited\InstallShield.targets(21,3):错误MSB4062:未能从程序集Microsoft.Build.Tasks.v3.5加载“Microsoft.Build.Tasks.AssignProjectConfiguration”任务。无法加载文件或程序集“Microsoft.Build.Tasks.v3.5”或其依赖项之一。系统找不到指定的文件。确认声明正确,程序集及其所有依赖项可用,并且任务包含实现Microsoft.Build.Framework.ITask的公共类。
我的搜索结果让我得出结论,我必须购买InstallShield的Premier版本才能从ISCmdBuild中获利。但我负担不起,我想可能还有另一个解决办法


有什么想法吗?

我找到了解决办法。使用命令
devenv.exe
而不是
MSBuild.exe
。这类似于启动VisualStudio并单击Build按钮。就这些

devenv.exe MySolution.sln /build Release

另一种解决方案是强制MSBuild使用x86平台。看

如果您是从TFS生成生成,则可以从以下位置进行配置:


使用Fusion日志记录,MSBuild在此处检查DLL:file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Tasks.v3.5.DLL.

我抄了 c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Build.Tasks.v3.5.dll 到 c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Build.Tasks.v3.5.dll

错误消失了

或者打开*.isproj文件,并在标签顶部从“3.5”更改为“4.0”:

<Project ToolsVersion="3.5"...> --> <Project ToolsVersion="4.0" ...>
-->

我没有TFS,所以我尝试了您的第一个解决方案。不幸的是,MSBuild指出“指定的解决方案配置版本| x86”无效。不幸的是,我需要管理员权限来复制此目录中的文件。而且我没有它们…然后尝试在InstallShield安装文件中从3.5更改为4.0:我尝试了以下ToolsVersion{“4”、“4.0”、“4.5”、“4.0.30319}的值。他们都不工作,为我工作。我删除了DLL,并在isproj文件中更改了该值,签入后,它的构建没有3.5引用错误。这很奇怪。。。我不知道该说什么。