简体   繁体   English

带有TFS的MSBuild在具有多个项目的ASP.NET部署上失败

[英]MSBuild with TFS Fails on ASP.NET deploy with multiple projects

I'm using Visual Studio 2012 and TFS and I have an issue with builds. 我正在使用Visual Studio 2012和TFS,我遇到了构建问题。 I currently have a 2 projects solution (One with the main project, the other with only the resources files) But only the main project has a Publish Profile, the other one doesn't have one it's just a dependency to the first one and need only to be compiled. 我目前有一个2项目解决方案(一个与主项目,另一个只有资源文件)但只有主项目有一个发布配置文件,另一个没有一个它只是一个依赖于第一个和需要只是编译。

But when i launch the build i got this error : 但是当我启动构建时出现了这个错误:

C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v11.0\\Web\\Microsoft.Web.Publishing.targets (4435): The value for PublishProfile is set to 'Dev', expected to find the file at 'e:\\Builds\\6\\DEV.MyProject\\Sources\\MyProject.Resources\\Properties\\PublishProfiles\\Dev.pubxml' but it could not be found. C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v11.0 \\ Web \\ Microsoft.Web.Publishing.targets(4435):PublishProfile的值设置为'Dev',期望在''找到文件' e:\\ Builds \\ 6 \\ DEV.MyProject \\ Sources \\ MyProject.Resources \\ Properties \\ PublishProfiles \\ Dev.pubxml'但找不到它。 C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v11.0\\Web\\Microsoft.Web.Publishing.targets (4442): PublishProfile(Dev) is set. C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v11.0 \\ Web \\ Microsoft.Web.Publishing.targets(4442):设置了PublishProfile(Dev)。 But the $(WebPublishMethod) does not have a valid value. 但$(WebPublishMethod)没有有效值。 Current Value is "". 当前值为“”。 C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v11.0\\Web\\Microsoft.Web.Publishing.targets (4449): Target ValidatePublishProfileSettings Failed C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ VisualStudio \\ v11.0 \\ Web \\ Microsoft.Web.Publishing.targets(4449):目标ValidatePublishProfileSettings失败

So is there a way through MSBuild Arguments that i can publish my app, by only compiling one project and then compiling + publishing the second one ? 那么有没有办法通过MSBuild Arguments我可以发布我的应用程序,只编译一个项目然后编译+发布第二个项目?

Thanks, 谢谢,

The problem is solved since a bit of time but didn't remember to answer :D. 问题解决了一段时间,但不记得回答:D。

So the problem was : My Resources Project (To get a better separation of dlls) won't compile in MSBuild because of a non-existent Publish Profile. 所以问题是:我的资源项目(为了更好地分离dll)将无法在MSBuild中编译,因为不存在发布配置文件。 It's all because of the type of project i created. 这都是因为我创建的项目类型。 The project was a ASP.NET MVC Application so MSBuild tried to Compile AND Publish it. 该项目是一个ASP.NET MVC应用程序,因此MSBuild尝试编译并发布它。 Which was impossible because there was no publish profile and it wasn't design to be. 这是不可能的,因为没有发布配置文件,它不是设计。

I changed my project from being a ASP Application to a Class Library and it worked perfectly fine. 我将我的项目从ASP应用程序更改为类库,它工作得很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM