如何用msbuild构建一个包含几个silverlight项目的ASP.Net站点?

时间:2021-08-22 00:10:21

I have a VS2008 solution that contains and ASP.Net website, an ASP.Net WCF service, and several silverlight projects/applications. Building the solution under any of the Configurations that I have defined (Debug, Staging, Release) in the IDE works great. I also have an MSbuild project that builds the solution using an MSBuild Task, runs all the unit tests, and then deploys the site and the service etc. via FTP.

我有一个VS2008解决方案,包含ASP.Net网站,ASP.Net WCF服务和几个silverlight项目/应用程序。在IDE中定义的任何配置(调试,暂存,发布)下构建解决方案非常有效。我还有一个MSbuild项目,使用MSBuild任务构建解决方案,运行所有单元测试,然后通过FTP部署站点和服务等。

If I do a clean build in the msbuild project, it fails as it seems to fail to copy over the built silverlight libraries into the dependent projects and I get lots of missing reference errors. If I just open up the solution in the IDE, switch to the same Configuration and build, it works fine and then the msbuild project works fine.

如果我在msbuild项目中进行了一个干净的构建,它会失败,因为它似乎无法将构建的Silverlight库复制到依赖项目中,并且我得到了很多缺少的引用错误。如果我只是在IDE中打开解决方案,切换到相同的配置和构建,它工作正常,然后msbuild项目工作正常。

What special steps do I need to take to build a solution that contains silverlight projects? Do I need to specifically build all the projects and copy over the dll outputs??

我需要采取哪些特殊步骤来构建包含silverlight项目的解决方案?我是否需要专门构建所有项目并复制dll输出?

I am new to msbuild. Thanks in advance. Here is how I am building the sln file in the msbuild project:

我是msbuild的新手。提前致谢。以下是我在msbuild项目中构建sln文件的方法:

<MSBuild Projects="mainsite.sln" Properties="Configuration=$(Configuration)" />

1 个解决方案

#1


Rather than build each project to a different directory, and then rely on copying the dependant assemblies locallly, I would change all of the projects to output to the same directory and then turn off the CopyLocal option on the references between the projects.

不是将每个项目构建到不同的目录,然后依赖于locallly复制依赖程序集,我会将所有项目更改为输出到同一目录,然后关闭项目之间引用的CopyLocal选项。

#1


Rather than build each project to a different directory, and then rely on copying the dependant assemblies locallly, I would change all of the projects to output to the same directory and then turn off the CopyLocal option on the references between the projects.

不是将每个项目构建到不同的目录,然后依赖于locallly复制依赖程序集,我会将所有项目更改为输出到同一目录,然后关闭项目之间引用的CopyLocal选项。