在Visual Studio Team Services中轻松构建和部署(到Azure)ASP.NET 5的简便方法 [英] Easy way to build and deploy (to Azure) ASP.NET 5 in Visual Studio Team Services

查看:95
本文介绍了在Visual Studio Team Services中轻松构建和部署(到Azure)ASP.NET 5的简便方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个示例ASP.NET 5应用程序(几乎是新解决方案"中的示例),并将其推送到了Visual Studio Team Services(以前称为Visual Studio Online)上托管的GIT.我想设置与Azure Web App(以前的Azure网站)的持续集成.我尝试从Azure门户本身进行设置,但确实创建了新的生成定义,但是无法生成ASP.NET5.我找到了

I have create a sample ASP.NET 5 application (pretty much the example one from New Solution), and pushed it to GIT hosted on Visual Studio Team Services (former Visual Studio Online). I want to set up continuous integration to Azure Web App (former Azure Web Site). I have tried to set it up from Azure portal itself, it did create a new build definition, but it fails to build ASP.NET 5. I have found a guide how to do this, but it never really worked for me, I get errors like this e.g.

解析C:\ a \ 1 \ s \ Frontend \ src \ Frontend \ Frontend.xproj的解决方案文件时出错:调用的目标引发了异常.

Error parsing solution file at C:\a\1\s\Frontend\src\Frontend\Frontend.xproj: Exception has been thrown by the target of an invocation.

未定义或导入"System.Void"预定义类型

Predefined type 'System.Void' is not defined or imported

另一个问题是,安装dnvm,获取软件包等确实需要很多时间.因此,总的来说,要使其正常工作是很痛苦的.

Another problem is that it seems it really takes a lot of time to install dnvm, get packages, etc. So all in all it's a pain to make it work.

因此,有真正的替代方案,或更重要的是,Microsoft计划实施诸如Build ASP.NET 5,将ASP.NET部署到Azure之类的方法,以简化这一点,就像我认为使用当前的ASP一样容易. NET 4应用程序.我真的希望它会很快成为一种选择,因为使用当前的构建系统几乎是不可能的.

So are there real alternatives for that or more importantly is Microsoft is planning to implement something like a Build ASP.NET 5, Deploy ASP.NET to Azure and such to make it easy as I suppose it's easy with the current ASP.NET 4 apps. I really hope that it will be an option soon since it's quite impossible to work with current build system.

推荐答案

对于"System.Void"问题,请检查"global.json"文件中的运行时版本,并确保它与项目"中的依赖项一致. json"文件.

For "System.Void" issue, please check the runtime version in "global.json" file and make sure it is consistent with the dependencies in "project.json" file.

对于dnvm安装问题,由于VSTS托管生成代理目前尚未安装AspNet5运行时环境,并且不同的用户可能使用不同的运行时版本,因此它要求用户添加"PreBuild" PowerShell步骤以读取运行时版本在"global.json"文件中,然后安装它.如果可以确保始终只使用一个版本(例如:1.0.0-rc1-update1),则可以

For dnvm install issue, since AspNet5 runtime environment isn't installed on VSTS Hosted Build Agent for now and the different users may use different runtime versions, it requires the user to add a "PreBuild" PowerShell step to read the runtime version in "global.json" file and then install it. If you can make sure that you will always only use one version (For example: 1.0.0-rc1-update1), you can deploy your own build agent and install "1.0.0-rc1-update1" on it, then you can skip the dnvm installation during the build process.

这篇关于在Visual Studio Team Services中轻松构建和部署(到Azure)ASP.NET 5的简便方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆