Silverlight和MSBuild的问题

Silverlight和MSBuild的问题

本文介绍了PackageRestore,Silverlight和MSBuild的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 NugetPowerTools PackageRestore 避免放置我们的svn中的packages文件夹.这可以使用Visual Studio和MSBuild构建.NET项目.它还可以使用Visual Studio构建Silverlight项目.

We use NugetPowerTools PackageRestore to avoid putting our packages folder in svn. This works building .NET projects with Visual Studio and MSBuild. It also works building Silverlight projects with Visual Studio.

但是,当我们使用MSBuild构建Silverlight项目时,构建失败.这似乎与Microsoft.Silverlight.Common.targets中的任务有关.查看MSBuild输出,它似乎在错误之前已到达步骤GetXapOutputFile.在该步骤中或该步骤之后的某个内容正在寻找软件包,但是直到完成所有这些操作之后,软件包还原才会运行.第二次建造会成功.

However, when we use MSBuild to build Silverlight projects, the build fails. This appears to have to do with the tasks in Microsoft.Silverlight.Common.targets. Looking at the MSBuild output, it appears to get to the step GetXapOutputFile before it errors. Something either in that step, or after that step, is looking for the packages, but the package restore does not run until after all of this. Building a second time will succeed.

与在Visual Studio中按构建而不是在运行MSBuild相比有什么不同?我是否缺少命令行开关?

What is different from pressing build in Visual Studio than running MSBuild? Is there a command line switch I am missing?

如果这行不通,是否可以通过某种方式更改由NuGetPowerTools创建的NuGet.targets或可以放入csproj文件中的内容来切换这些步骤的运行顺序?

If that won't work, is there some way I can change the NuGet.targets created by NuGetPowerTools or something I can put in my csproj file that will switch the order these steps are run?

我正在运行MSBuild Solution.sln /target:Clean;Rebuild

修改

我已经将NuGet更新到v1.6,删除了NuGetPowerTools的所有痕迹,并且现在使用内置的Package Restore选项.我仍然收到此错误.

I've update NuGet to v1.6, removed all traces of NuGetPowerTools and I am now using the built in Package Restore option. I am still getting this error.

再次编辑

有关此问题的讨论再次出现.我现在已经使用NuGet v2.0对此进行了测试,并且这种情况仍在发生.

A discussion around this issue has come up again. I've tested this now with NuGet v2.0 and it is still happening.

推荐答案

此问题已在NuGet v2.1.31002.9028中得到纠正.详细信息可以在此提交中找到.

This has been corrected in NuGet v2.1.31002.9028. The details can be found in this commit.

对于现有解决方案,您需要从解决方案中删除./nuget/NuGet.targets.通过Windows资源管理器执行此操作.通过Visual Studio删除它只会从您的解决方案中删除该文件,而将使文件独自保留.

For existing solutions, you will need to delete ./nuget/NuGet.targets from your solution. Do this through Windows Explorer. Deleting it through Visual Studio will only remove the file from your solution, it will leave the file alone.

完成此操作后,右键单击您的解决方案,然后选择启用程序包还原".这将使用修复程序重新创建NuGet.targets.

Once you have done this, right click on your solution and select "Enable Package Restore". This will recreate NuGet.targets with the fix.

这篇关于PackageRestore,Silverlight和MSBuild的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 23:50