本文介绍了MSBuild 命令行错误 - Silverlight 4 SDK 未安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的MSBuild命令行如下:

msbuild e:codemyProject.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) 构建引擎版本 4.0.30319.1[微软 .NET 框架,版本 4.0.30319.1]版权所有 (C) Microsoft Corporation 2007.保留所有权利.构建于 2010 年 6 月 8 日下午 4:03:38 开始.项目E:codedashboardsMyProject2010MyProject2010.WebMyProject2010.web.csproj"在节点 1(默认目标)上.生成TargetFrameworkMonikerAttribute:跳过目标GenerateTargetFrameworkMonikerAttribute",因为所有输出 fi文件相对于输入文件是最新的.核心编译:跳过目标CoreCompile",因为所有输出文件都是最新的ect到输入文件.复制文件到输出目录:将文件从objDebugMyProject.Web.dll"复制到binDebugMyProject.Web".dll".MyProject2010.web -> E:codedashboardsMyProject2010MyProject2010.WebinDebugMyProject.Web.dll将文件从objDebugMyProject.Web.pdb"复制到binDebugMyProject.Web".pdb".项目E:codedashboardsMyProject2010MyProject2010.WebMyProject2010.web.csproj"(1)正在构建E:codedashboardsMyProject2010MyProject2010.ClientMyProject2010.Client.csproj" (2) 在节点 1(GetXapOutputFile 目标(s)).C:Program Files (x86)MSBuildMicrosoftSilverlightv4.0Microsoft.Silverlight.Common.targets(104,9): 错误:未安装 Silverlight 4 SDK.[E:鳕鱼edashboardsMyProject2010MyProject2010.ClientMyProject2010.Client.cspr哦]完成构建项目E:codedashboardsMyProject2010MyProject2010.ClientMyProject2010.Client.csproj"(GetXapOutputFile 目标)——失败.完成构建项目E:codedashboardsMyProject2010MyProject2010.WebMyProject2010.web.csproj"(默认目标)——失败.构建失败."E:codedashboardsMyProject2010MyProject2010.WebMyProject2010.web.csproj"(默认目标)(1) ->"E:codedashboardsMyProject2010MyProject2010.ClientMyProject2010.Client.csproj"(GetXapOutputFile 目标)(2)->(GetFrameworkPaths 目标)->C:Program Files (x86)MSBuildMicrosoftSilverlightv4.0Microsoft.Silverlight.Common.targets(104,9): 错误:未安装 Silverlight 4 SDK.[E:codedashboardsMyProject2010MyProject2010.ClientMyProject2010.Client.cs项目]0 警告1 错误已用时间 00:00:00.39

我感谢任何人的帮助.谢谢.

解决方案

我想通了 - MSBuild 中有一个设置,您可以在其中为 MSBuild 选择 x64 或 x86 环境(在您设置 MSBuild 标志的同一页面中)-将其设置为 x86,一切都会正常运行.

My MSBuild command line is as follows:

msbuild e:codemyProject.csproj /p:Configuration=Debug /p:OutputPath=bin/Debug /p:Platform=x86 /p:PlatformTarget=x86

The project builds fine on my development machine in VS2010 but not with the command above. I am running Win 7 64 - Bit. I'm getting an error that says I don't have the Silverlight 4 SDK installed but I do. I"ve read some posts that you have to set the Platform=x86 but to no avail. Here is the error message in full:

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:codedashboardsMyProject2010MyProject2010.WebMyProject2010
.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 "objDebugMyProject.Web.dll" to "binDebugMyProject.Web
  .dll".
  MyProject2010.web -> E:codedashboardsMyProject2010MyProject2010.Web
  inDebugMyProject.Web.dll
  Copying file from "objDebugMyProject.Web.pdb" to "binDebugMyProject.Web
  .pdb".
Project "E:codedashboardsMyProject2010MyProject2010.WebMyProject2010
.web.csproj" (1) is building "E:codedashboardsMyProject2010MyProject20
10.ClientMyProject2010.Client.csproj" (2) on node 1 (GetXapOutputFile target(
s)).
C:Program Files (x86)MSBuildMicrosoftSilverlightv4.0Microsoft.Silverlight
.Common.targets(104,9): error : The Silverlight 4 SDK is not installed. [E:cod
edashboardsMyProject2010MyProject2010.ClientMyProject2010.Client.cspr
oj]
Done Building Project "E:codedashboardsMyProject2010MyProject2010.Clie
ntMyProject2010.Client.csproj" (GetXapOutputFile target(s)) -- FAILED.

Done Building Project "E:codedashboardsMyProject2010MyProject2010.Web
MyProject2010.web.csproj" (default targets) -- FAILED.


Build FAILED.

"E:codedashboardsMyProject2010MyProject2010.WebMyProject2010.web.csp
roj" (default target) (1) ->
"E:codedashboardsMyProject2010MyProject2010.ClientMyProject2010.Clie
nt.csproj" (GetXapOutputFile target) (2) ->
(GetFrameworkPaths target) ->
  C:Program Files (x86)MSBuildMicrosoftSilverlightv4.0Microsoft.Silverlig
ht.Common.targets(104,9): error : The Silverlight 4 SDK is not installed. [E:c
odedashboardsMyProject2010MyProject2010.ClientMyProject2010.Client.cs
proj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.39

I appreciate anyone's help. Thanks.

解决方案

I figured this out - there is a setting in MSBuild where you can choose x64 or x86 environment for MSBuild (in the same page where you set MSBuild flags) - set it to x86 and everything will work.

这篇关于MSBuild 命令行错误 - Silverlight 4 SDK 未安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 01:11