Isaac Levin
Isaac Levin

Reputation: 2899

dotnet publish project does not contain a project.json file

I have a Dot Net Core Project targeting .Net Framework 4.5.2 and I just converted it to .csproj. I am trying to publish using CLI and I get the following error

does not contain a project.json file

If I run 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

I thought that upgrading to csproj made it so I no longer need project.json. The ultimate goal is to plug this project into CI/CD with VSTs. I found this SO

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

And do not have the mentioned references, here is my csproj file

<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>

What do I need to do here?

Upvotes: 2

Views: 2059

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33698

Using Hosted VS 2017 agent or an on premise build agent with latest version of sdk.

Note: The core version is 1.0.0-preview2-1-003177 version in Hosted agent.

Upvotes: 2

Related Questions