dotnet发布项目不包含project.json文件

时间:2017-05-18 19:16:06

标签: .net asp.net-core azure-pipelines

我有一个针对.Net Framework 4.5.2的Dot Net Core项目,我刚将其转换为.csproj。我试图使用CLI发布,我收到以下错误

  

不包含project.json文件

如果我运行dotnet --info

.NET Command Line Tools (1.0.0-preview2-003131)

Product Information:
  Version:            1.0.0-preview2-003131
  Commit SHA-1 hash:  635cf40e58

Runtime Environment:
  OS Name:     Windows
  OS Version:  10.0.15063
  OS Platform: Windows
  RID:         win10-x64

Microsoft .NET Core Shared Framework Host

 Version  : 2.0.0-preview1-002111-00
 Build    : 1ff021936263d492539399688f46fd3827169983

我认为升级到csproj使得我不再需要project.json。最终目标是将此项目插入带有VST的CI / CD。我找到了这个SO

Dotnet publish-iis exit with code 1. Project.json not found when using .csproj?

并且没有提到的引用,这是我的csproj文件

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
     <TargetFramework>net452</TargetFramework>
     <PreserveCompilationContext>true</PreserveCompilationContext>
     <AssemblyName>Pricing.Web</AssemblyName>
     <OutputType>Exe</OutputType>
     <PackageId>Pricing.Web</PackageId>
  </PropertyGroup>
  <ItemGroup>
     <None Include="App.config" />
     <None Update="wwwroot\**\*;EmailTemplates\*;nlog.config">
       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
     </None>
  </ItemGroup>
  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
     <PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="1.1.2" />
     <PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.1" />
     <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.1" />
    <PackageReference Include="Webpack" Version="3.0.0" />
    <PackageReference Include="Microsoft.TypeScript.MSBuild" Version="2.2.1" />
    <PackageReference Include="Microsoft.TypeScript.Compiler" Version="2.2.1" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
    <PackageReference Include="Microsoft.Owin.Security.ActiveDirectory" Version="3.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="1.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.1" />
    <PackageReference Include="Microsoft.Owin.Security" Version="3.0.1" />
    <PackageReference Include="Microsoft.Owin.Security.Cookies" Version="3.0.1" />
    <PackageReference Include="Microsoft.Owin.Security.OpenIdConnect" Version="3.0.1" />
    <PackageReference Include="Microsoft.AspNet.Identity.Core" Version="2.2.1" />
    <PackageReference Include="EntityFramework" Version="6.1.3" />
    <PackageReference Include="NLog.Extensions.Logging" Version="1.0.0-*" />
    <PackageReference Include="AutoMapper" Version="5.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.1" />
    <PackageReference Include="NLog.Web.AspNetCore" Version="4.3.1" />
    <PackageReference Include="Sendgrid" Version="9.1.1" />
 </ItemGroup>
 <ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
    <Reference Include="System" />
    <Reference Include="Microsoft.CSharp" />
 </ItemGroup>
</Project>

我需要在这做什么?

1 个答案:

答案 0 :(得分:1)

使用托管VS 2017 代理或内部版本代理与最新版本的sdk。

注意:核心版本是托管代理中的1.0.0-preview2-1-003177版本。