首页 文章

在构建服务器上构建.NET Core 1.0 RC2应用程序

提问于
浏览
11

我已将我的应用程序从DNX,ASP.NET 5 RC1更新为ASP.NET Core 1.0 RC2 . 在本地,它 Build 并运行良好 .

在构建服务器上,我没有安装Visual Studio,并且构建失败:

错误MSB4019:找不到导入的项目“C:\ Program Files(x86)\ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ DotNet \ Microsoft.DotNet.Props” . 确认声明中的路径是否正确,以及该文件是否存在于磁盘上 .

我确实安装了:.NET Core SDK for Windows . 尝试安装VS 2015工具预览失败的原因是:

enter image description here

在构建服务器上构建.NET Core 1.0 RC2应用程序而不必安装Visual Studio 2015的正确设置是什么?

注意:构建框(TeamCity 9)可以为.NET 4.5和DNX构建/运行测试 .

4 回答

  • 1

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

    问题由于临时错误,您可能无法为Visual Studio 2015安装程序安装.NET Core Tooling Preview 2 . 要解决此问题,请使用 SKIP_VSU_CHECK=1 参数从命令行运行安装程序,如下面的示例所示 .

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

  • 0

    我现在能够 build 解决方案了 . Still can't publish though .

    我刚刚将所有新的MSBuild内容复制到构建服务器 . 我复制了:

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

    从我的本地计算机到构建服务器 . 这包括新的 DotNet 子文件夹,其中包含:

    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
    

    我可以构建解决方案(没有发布参数),当我尝试时它失败了:

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

  • 3

    您可以通过命令行构建和测试项目 - 因此无需安装Visual Studio . 通过使用“命令行”类型的构建步骤,您可以运行:dotnet restore,dotnet build,dotnet test

    在这里,您可以找到一些描述如何在TFS上构建它 . 它是为托管TFS编写的,但也在本地工作(并且不仅仅是因为文档的名称可能意味着azure):https://www.visualstudio.com/en-us/docs/build/apps/aspnet/aspnetcore-to-azure

    对于pubsishing我已经使用带有RC1的msdeploy但尚未迁移我的部署版本 . 如果在接下来的几天内完成,我可能会在此处记录 .

  • 0

    因此,如果没有Visual Studio或Web Deploy,我的TeamCity构建包含4个构建步骤:

    dotnet restore
    dotnet build
    dotnet test
    dotnet publish -c Release
    

    我用一个基本的for循环运行dotnet test on all projects .

相关问题