Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

2.0 Preview 2 images don't appear to run against project compiled against 2.0 preview 2 #261

Closed
cmaslen opened this issue Jul 3, 2017 · 4 comments
Labels
closed-external Closed because the issue is external to the project in this repo.

Comments

@cmaslen
Copy link

cmaslen commented Jul 3, 2017

After updating my SDK (and companion VS version) to Core 2.0 preview 2 running any ASP.NET Core app in the aspnet-docker container fails. I have tried the following images:

  • aspnetcore:2.0
  • aspnetcore:2.0.0-preview2
  • aspnetcore:2.0.0-preview2-stretch

Steps to reproduce the issue

(e.g. copy your Dockerfile or docker-compose.yml file here)

  1. After downloading VS 2017 (15.3.0 Preview 3.0), create new Web API project with Docker support.
  2. Running the app works fine at this point, but VS defaults to targeting .NET Core 1.1.
  3. Change web project to target .NET Core 2.0. At this point running in Docker fails because the target runtime is later than the installed runtime (fair enough)
  4. Change Dockerfile to use one of the 2.0.0 images (above).

Expected behavior

The application runs as before. The browser window launches pointing to the running app inside the Docker container.

Actual behavior

We get the following exception:
System.AggregateException occurred
HResult=0x80131500
Message=One or more errors occurred.
Source=
StackTrace:

Inner Exception 1:
DllNotFoundException: Unable to load DLL 'libuv': The specified module or one of its dependencies could not be found.
(Exception from HRESULT: 0x8007007E)

Additional information (e.g. issue happens only occasionally)

Reproducible every time.
I also uninstalled preview 1 for version 2.0.

Output of dotnet --info


    Microsoft .NET Core Shared Framework Host

    Version  : 2.0.0-preview2-25407-01
    Build    : 40c565230930ead58a50719c0ec799df77bddee9

@natemcmaster
Copy link
Contributor

Can you share your csproj file as well?

@cmaslen
Copy link
Author

cmaslen commented Jul 3, 2017

Hi @natemcmaster,

Thanks for the reply. Below is the project file:

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

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
  </ItemGroup>

</Project>

Also the output of dotnet --info from my own machine which I've noticed is different to the version in the Docker container.

.NET Command Line Tools (2.0.0-preview2-006497)

Product Information:
 Version:            2.0.0-preview2-006497
 Commit SHA-1 hash:  06a2093335

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0-preview2-006497\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview2-25407-01
  Build    : 40c565230930ead58a50719c0ec799df77bddee9

@natemcmaster
Copy link
Contributor

You project is still using AspNetCore 1.1 packages. Upgrade your PackageReference's to 2.0.0-preview2.

@cmaslen
Copy link
Author

cmaslen commented Jul 3, 2017

Hi @natemcmaster,

That appears to have fixed it although the exact versions are not all preveiw2. Below is my corrected project file:

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

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore" Version="2.0.0-preview2-final" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0-preview2-final" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0-preview2-final" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
  </ItemGroup>

</Project>

Thanks again. I'll try to track down a VS forum to raise the bug in since a project file should not require manual editing when using VS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-external Closed because the issue is external to the project in this repo.
Projects
None yet
Development

No branches or pull requests

2 participants