1

I am migrated a NET Core 1.0 project with project.json file to Net Core 1.1 project with .csproj file. At the end of the .csproj file I have the following:

<ItemGroup>
  <DotNetCliToolReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools" Version="1.1.0-preview4-final" />
  <DotNetCliToolReference Include="Microsoft.AspNetCore.Server.IISIntegration.Tools" Version="1.1.0-preview4-final" />
  <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.1.0-preview4-final" />
  <DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.1.0-preview4-final" />        
</ItemGroup>  

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

<Target Name="Prepublish" BeforeTargets="PrepareForPublish" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
  <Exec Command="npm install" />
  <Exec Command="bower install" /> 
  <Exec Command="gulp clean" />
  <Exec Command="gulp build" />
</Target>  

<Target Name="Postpublish" AfterTargets="Publish" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">    
  <Exec Command="dotnet publish-iis --publish-folder $(TargetDir) --framework $(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)" />
</Target>    

When publishing the project I get the error on dotnet publish-iis:

exited with code 1.

I tried to find the error and the only thing I found was:

System.IO.FileNotFoundException: Could not find file 'C:\MVCProj\project.json'.

But why is it looking for the project.json file if I am using .csproj?

1 Answer 1

2

If you are still looking for the answer, I discovered that the publish-iis cli tools are no longer used.

https://github.com/dotnet/cli/issues/4855#issuecomment-263799301

You need to remove the reference to the Microsoft.AspNetCore.Server.IISIntegration.Tools package and the whoe PostpublishTarget from your .csproj file.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.