Closed SimonVuong closed 7 years ago
Can you share your csproj file?
Yes. The .csprj file would make sense to add :)
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<!-- <RuntimeFrameworkVersion>1.0.0</RuntimeFrameworkVersion> -->
</PropertyGroup>
<ItemGroup>
<!--specify wwwroot as the public client folder-->
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
</ItemGroup>
<!--allows us to run "dotnet watch run" which restarts the client/server respecitively when there is a change in code-->
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
</ItemGroup>
<!--<Target Name="Build Angular" Condition="'$(Configuration)'=='Release'" BeforeTargets="Build">
<Message Text="* * * * * * Building Angular App * * * * * *" Importance="high" />
<Exec Command="ng build -prod -aot" />
</Target>-->
</Project>
@SimonVuong / @Simon-Vuong - I followed your steps exactly and was unable to reproduce the issue. The error you got leads me to believe you may have used microsoft/aspnetcore:1.0
, microsoft/aspnetcore:2.0
, or microsoft/aspnetcore:latest
.
I noticed that dotnet restore installs Microsoft.NETCore.App 1.0.0. Why is that? How can I make it install the right thing?
There are two reasons this would appear in the console output.
<RuntimeFrameworkVersion>1.0.0</RuntimeFrameworkVersion>
. This overrides the version of Microsoft.NETCore.App. In a netcoreapp1.1
project, RuntimeFrameworkVersion defaults to 1.1.2.<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
. dotnet-watch is itself a .NET Core 1.0.0 app. It's installation is independent from the TargetFramework
value in you project.By the way, console output can be misleading and is not the best way to determine what is actually restore. The restore result can be found by examining obj/project.assets.json
.
I changed the TargetFramework to netcoreapp1.0 and it works. Unfortunately, I'm still a little confused as to what is happening exactly. I suspect my Jenkins dotnet core sdk was 1.0.1 even though the "Microsoft .NET Core Shared Framework Host" was at version 1.1.0.
Ok. I'm closing as there doesn't appear to be any changes required to Docker images.
There is the same problem with my project, the workaround to resolve it successfully is that remove the item 'C:\Program Files (x86)\dotnet' from the Path of Environment Variable because I found I did not install the right netcore version under X86. I have not tried to install the proper version with x86, appreciate that you tell me if you have done that test.
Steps to reproduce the issue
We are building our aspnetcore app image in Jenkins and running the image in OpenShift.
/tools/docker/docker-1.11.2/docker build --force-rm --no-cache --pull --rm=true -t $DOCKER_LOCATION:latest .
Expected behavior
image runs successfully
Actual behavior
image fails to run with error...
Additional information (e.g. issue happens only occasionally)
Output of
dotnet --info
in JenkinsOutput of
dotnet --version
in JenkinsOutput of
dotnet
in JenkinsOutput of
dotnet restore
in JenkinsOutput of
docker info
I noticed that dotnet restore installs Microsoft.NETCore.App 1.0.0. Why is that? How can I make it install the right thing?