Building .NET Core 1.0 RC2 app on the build server
Asked Answered
M

4

11

I've updated my app from DNX, ASP.NET 5 RC1 to ASP.NET Core 1.0 RC2. Locally it builds and runs fine.

On the build server, I don't have Visual Studio installed, and the build fails with:

error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I did install the: .NET Core SDK for Windows. Trying to install the VS 2015 tooling preview fails with:

enter image description here

What would be the correct setup to build .NET Core 1.0 RC2 app on the build server without having to install Visual Studio 2015?

Note: The build box (TeamCity 9) builds/runs tests fine for .NET 4.5 and DNX.

Mutton answered 19/5, 2016 at 14:39 Comment(0)
M
0

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.

Mutton answered 23/8, 2016 at 8:32 Comment(0)
C
3

https://learn.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

Capriole answered 31/7, 2016 at 18:34 Comment(2)
Doesn't work for me. It shows the same "I want the full VS 2015" message.Interjacent
This workaround doesn't work for the 1.0.1 release of this installer.Digged
M
1

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

Mutton answered 23/5, 2016 at 15:53 Comment(0)
R
0

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.

Ridgway answered 19/7, 2016 at 14:32 Comment(0)
M
0

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.

Mutton answered 23/8, 2016 at 8:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.