Building .NET Core 1.0 RC2 app on the build server

狂风中的少年 提交于 2019-12-03 05:58:35
qingzhoufanyue

https://docs.microsoft.com/en-us/dotnet/articles/core/windows-prerequisites#issues

Issues You may be blocked from installing the .NET Core Tooling Preview 2 for Visual Studio 2015 installer due to a temporary bug. To workaround it, run the installer from the commandline with the SKIP_VSU_CHECK=1 argument, as you see in the example below.

DotNetCore.1.0.0-VS2015Tools.Preview2.exe SKIP_VSU_CHECK=1

Bruno Garcia

I'm able to build the solution now. Still can't publish though.

I just copied all the new MSBuild stuff to the build server. I copied:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\

From my local computer to the build server. That includes the new DotNet sub-folder, which contains:

Microsoft.DotNet.Common.targets
Microsoft.DotNet.Extensions.targets
Microsoft.DotNet.props
Microsoft.DotNet.Publishing.targets
Microsoft.DotNet.targets
Microsoft.DotNet.Tasks.dll
Microsoft.VisualStudio.ProjectSystem.DotNet.Runtime.dll
Newtonsoft.Json.dll

I can build the Solution (without the publish arguments) it fails when I try:

MSBuild.exe Solution.sln /p:DeployOnBuild=true /p:publishprofile=local

You can build and test you project via the command line - so there is no need to have Visual Studio installed. By using build steps of type "Command Line" you can run: dotnet restore, dotnet build, dotnet test

Here you can find some description how to run that as a build on TFS. It is written for the hosted TFS but works on-premise as well (and is not only meant for azure as the name of the document might imply): https://www.visualstudio.com/en-us/docs/build/apps/aspnet/aspnetcore-to-azure

For the pubsishing I have used msdeploy with RC1 but have not yet migrated my deployment build. I might document it here when this is done within the next days.

Bruno Garcia

So without Visual Studio or Web Deploy, my TeamCity build is comprised of 4 builds steps:

dotnet restore
dotnet build
dotnet test
dotnet publish -c Release

I run dotnet test on all projects with a basic for loop.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!