AspNetCore - .xproj输出路径

时间:2017-01-08 23:23:15

标签: c# asp.net msbuild dnx .xproj

我一直试图逐步完成一些开源的MVC / ASP.NET核心代码,但每次遇到一些新项目时,在执行git clone后,我需要编辑.xproj } file来更改以下输出

<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\</OutputPath>

./bin/

否则我收到以下错误

Severity: Error
Code:
Description:
C:\Users\lndco\Documents\GitHub\RazorBlog\src\RazorBlog\error 
CS0006: Metadata file
'C:\Users\lndco\Documents\GitHub\RazorBlog\Mvc
\src\Microsoft.AspNetCore.Mvc.Formatters.Json
\bin\Debug\netstandard1.6\Microsoft.AspNetCore.Mvc.Formatters.Json.dll' 
could not be found    
Project: RazorBlog
File: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets

使用VS 2015 Update 3

为什么MsBuild没有确定引用程序集的输出是..\..\artifacts\bin\

的文件:

global.json

{
  "projects": [
    "src",
    "test",
    "Mvc/src",

  ],
  "sdk": {
    "version": "1.0.0-preview2-003131"
  }
}

AspNetCore poroject.json

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.1",
      "type": "platform"
    },
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.1",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },

    "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.0.1",
    "Microsoft.AspNetCore.Routing": "1.0.1",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.AspNetCore.WebUtilities": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

0 个答案:

没有答案