迁移 Teamcity 构建服务器时的依赖性问题
我正在将 Teamcity 服务器从一个虚拟机迁移到另一个虚拟机,因为我们要关闭托管当前虚拟机的办公室,我通过重建服务器而不是迁移虚拟机来实现此目的,因为 DC 之间存在大量基础设施差异。
大多数项目现在都在新服务器上构建得很好,但是有一个项目给了我一个错误。该解决方案在我的本地计算机和旧构建服务器上构建正常,只是在新服务器上出现此构建错误。错误消息中提到的类确实引用了 System.Net.Http 并且正在我的本地进行编译,这让我感到困惑。
\ExceptionHelper.cs(15, 28): 错误 CS1061: 'HttpRequestMessage' 确实 不包含“CreateResponse”的定义并且无法访问 扩展方法“CreateResponse”接受类型的第一个参数 可以找到“HttpRequestMessage”(您是否缺少 using 指令 或程序集参考?)
\ExceptionHelper.cs(31, 28): 错误 CS1061: “HttpRequestMessage”不包含定义 “CreateResponse”且没有可访问的扩展方法“CreateResponse” 可以找到接受“HttpRequestMessage”类型的第一个参数 (您是否缺少 using 指令或程序集引用?)
I'm migrating a Teamcity server from one VM to another as we're closing the office where the current VM is hosted, I'm doing this by rebuilding the server rather than migrating the VM as there's a bunch of infrastructure differences between the DCs.
The majority of projects are now building fine on the new server however one project is giving me an error. The solution builds ok on my local machine and on the old build server, it's just the new server where I get this build error. The class mentioned in the error message does have a reference to System.Net.Http and is compiling on my local which is what is confusing me.
\ExceptionHelper.cs(15, 28): error CS1061: 'HttpRequestMessage' does
not contain a definition for 'CreateResponse' and no accessible
extension method 'CreateResponse' accepting a first argument of type
'HttpRequestMessage' could be found (are you missing a using directive
or an assembly reference?)
\ExceptionHelper.cs(31, 28): error CS1061:
'HttpRequestMessage' does not contain a definition for
'CreateResponse' and no accessible extension method 'CreateResponse'
accepting a first argument of type 'HttpRequestMessage' could be found
(are you missing a using directive or an assembly reference?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,问题是没有安装 MVC 4。
尝试安装它时还存在一个额外问题,因为如果安装到辅助驱动器,VS 2019 安装程序实际上不会安装 MVC4,它会说它已安装,但如果您查看文件系统,文件并没有安装那里。如果您想要安装才能正常工作。
It turned out that the issue was MVC 4 wasn't installed.
There was also an additional issue when trying to install it in that the VS 2019 installer doesn't actually install MVC4 if installing to a secondary drive, it will say it has been installed but if you look in the file system the files aren't there. You must use this standalone installer if you want the installation to work properly.