使用MSBuild构建InstallShield LE项目-错误MSB4062

Raw*_*ean 3 msbuild installshield visual-studio

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

现在,我想拥有一个无需启动IDE即可构建完整解决方案的脚本。但是当我在命令行中运行MSBuild时,就像这样

MSBuild MySolution.sln /t:Build /p:Configuration=Release
Run Code Online (Sandbox Code Playgroud)

我收到以下错误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.
Run Code Online (Sandbox Code Playgroud)

我的搜索得出的结论是,我必须购买专业版的InstallShield才能获利ISCmdBuild。但是我负担不起,我认为可能还有另一种解决方案。

任何的想法?

Wol*_*lf5 5

使用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" ...>
Run Code Online (Sandbox Code Playgroud)