简体   繁体   English

MSBuild在临时ASP.NET文件上失败

[英]MSBuild fails on temporary ASP.NET files

I'm trying to set up Jenkins with MSBuild plugin. 我正在尝试使用MSBuild插件设置Jenkins。 I got Jenkins to check out solution from repository and run a build. 我让詹金斯(Jenkins)从存储库中签出解决方案并运行一个构建。 But every build fails with several 但是每一次构建都会失败

error CS0433: The type 'CustomControls_WarningPopup' exists in both (...)

WarningPopup is an .ascx defined twice - once per web site project, and there are two website projects in the solution. WarningPopup是一个两次定义的.ascx ,每个网站项目一次,解决方案中有两个网站项目。 The thing is this never rises any problems when compiling whole solution from VS2010. 问题是,从VS2010编译整个解决方案时,这永远不会出现任何问题。 Should I run MSBuild with some specific parameters to make it behaving like VS? 我应该使用一些特定的参数运行MSBuild使其表现得像VS吗?

I already tried moving Temporary ASP.NET files to custom folder (like in this answer) and it didn't help. 我已经尝试将Temporary ASP.NET files移动到自定义文件夹(例如答案),但没有帮助。 Probably I'm missing something obvious to CI experts here... 我可能在这里缺少CI专家显而易见的东西...

I found the cause. 我找到了原因。 There was another UserControl in second project which accidentally inherited class of the same name. 第二个项目中还有另一个UserControl ,它意外地继承了同名的类。 Both controls were in the same directory and nor Visual Studio during compilation nor ReSharper saw anything wrong with this. 这两个控件都在同一个目录中,并且在编译过程中也没有Visual Studio,ReSharper也没有发现任何错误。 Moreover MSBuild threw errors in both Web Projects despite the duplicated control was in only one of them. 此外,尽管只有一个控件存在重复控件,但MSBuild在两个Web项目中均引发了错误。 The funniest part is that this situation was like this for months and never rised any problems... 最有趣的是,这种情况已经持续了几个月,而且从未出现任何问题。

Anyway changing class of this control solved the issue and finally automated build succeeded! 无论如何,更改此控件的类都解决了该问题,最终自动构建成功!

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

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