dotnet / dotnet-docker

Docker images for .NET and the .NET Tools.
https://hub.docker.com/_/microsoft-dotnet
MIT License
4.5k stars 1.94k forks source link

Docker image to publish 2.0 project #258

Closed goforgold closed 7 years ago

goforgold commented 7 years ago

Steps to reproduce the issue

  1. I was using microsoft/dotnet:1.1-sdk-msbuild before upgrade
  2. Now, I've upgraded VS to preview version and upgraded my project to netcore2.0.
  3. Fixed a few issues during upgrade.
  4. Now I try to put microsoft/dotnet:2.0-sdk-msbuild

Expected behavior

Project should build

Actual behavior

Getting image not found error.

I tried removing -msbuild from tag but then image could load, dotnet restore ran successfully, but it couldn't build with errors like The type or namespace name 'System' could not be found. Actually, it can't find reference to any assembly i guess.

csproj file

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="Migrations\Scripts\" />
    <Folder Include="wwwroot\" />
    <Folder Include="Services\CustomExceptions\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="HtmlAgilityPack" Version="1.5.0-beta92" />
    <PackageReference Include="Microsoft.AspNetCore" Version="2.0.0-preview1-final" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0-preview1-final" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0-preview1-final" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0-preview1-final" />
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.0.0-preview1" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
    <PackageReference Include="AutoMapper" Version="6.1.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.0.0-preview1-final" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0-preview1-final" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.1" />
  </ItemGroup>

  <ItemGroup>
    <None Remove="Migrations\.DS_Store" />
  </ItemGroup>
</Project>

Any suggestions ?

goforgold commented 7 years ago

Found issue in my pipeline configuration.

I had -f netcoreapp1.1 parameter in my dotnet publish command. Removing this resolved the issue with build.

Thanks,