微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

MSBuild命令行错误 – 未安装Silverlight 4 SDK

我的MSBuild命令行如下:

msbuild e:\code\myProject.csproj /p:Configuration=Debug /p:OutputPath=bin/Debug /p:Platform=x86 /p:PlatformTarget=x86

该项目建立在我的开发机在VS2010,但不是上面的命令。我运行Win 7 64位。我得到一个错误,说我没有安装Silverlight 4 SDK,但我做。我已经读了一些帖子,你必须设置Platform = x86但无效。这是完整的错误消息:

Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework,Version 4.0.30319.1]
copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 6/8/2010 4:03:38 PM.
Project "E:\code\dashboards\MyProject2010\MyProject2010.Web\MyProject2010
.web.csproj" on node 1 (default targets).
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output fi
les are up-to-date with respect to the input files.
CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with resp
ect to the input files.
copyFilesToOutputDirectory:
  copying file from "obj\Debug\MyProject.Web.dll" to "bin\Debug\MyProject.Web
  .dll".
  MyProject2010.web -> E:\code\dashboards\MyProject2010\MyProject2010.Web
  \bin\Debug\MyProject.Web.dll
  copying file from "obj\Debug\MyProject.Web.pdb" to "bin\Debug\MyProject.Web
  .pdb".
Project "E:\code\dashboards\MyProject2010\MyProject2010.Web\MyProject2010
.web.csproj" (1) is building "E:\code\dashboards\MyProject2010\MyProject20
10.Client\MyProject2010.Client.csproj" (2) on node 1 (GetXapOutputFile target(
s)).
C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight
.Common.targets(104,9): error : The Silverlight 4 SDK is not installed. [E:\cod
e\dashboards\MyProject2010\MyProject2010.Client\MyProject2010.Client.cspr
oj]
Done Building Project "E:\code\dashboards\MyProject2010\MyProject2010.Clie
nt\MyProject2010.Client.csproj" (GetXapOutputFile target(s)) -- Failed.

Done Building Project "E:\code\dashboards\MyProject2010\MyProject2010.Web\
MyProject2010.web.csproj" (default targets) -- Failed.


Build Failed.

"E:\code\dashboards\MyProject2010\MyProject2010.Web\MyProject2010.web.csp
roj" (default target) (1) ->
"E:\code\dashboards\MyProject2010\MyProject2010.Client\MyProject2010.Clie
nt.csproj" (GetXapOutputFile target) (2) ->
(GetFrameworkPaths target) ->
  C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlig
ht.Common.targets(104,9): error : The Silverlight 4 SDK is not installed. [E:\c
ode\dashboards\MyProject2010\MyProject2010.Client\MyProject2010.Client.cs
proj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.39

我欣赏任何人的帮助。谢谢。

解决方法

我想出了这一点 – 在MSBuild有一个设置,你可以为MSBuild选择x64或x86环境(在设置MSBuild标志的相同页面) – 设置为x86,一切都会工作。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐