New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet run fails with 'assembly specified in the dependencies manifest was not found' for netcoreapp1.0 apps #6390

Closed
codito opened this Issue Apr 24, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@codito
Copy link
Contributor

codito commented Apr 24, 2017

Steps to reproduce

  1. Get the latest dev build of dotnet-cli
  2. Install shared runtime 1.0.4
  3. Use the following csproj
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NewtonSoft.Json" Version="9.0.1" />
  </ItemGroup>

</Project>
  1. Run following commands
$ dotnet restore
$ dotnet build
$ dotnet run

Expected behavior

App runs successfully.

Actual behavior

App fails with following error:

Error: assembly specified in the dependencies manifest was not found -- package: 'Newtonsoft.Json', version: '9.0.1', path: 'lib/netstandard1.0/Newtonsoft.Json.dll'

Environment data

dotnet --info output:

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

Product Information:
 Version:            2.0.0-preview2-005840
 Commit SHA-1 hash:  8f2fcef544

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /home/armahapa/src/vstest/tools/dotnet/sdk/2.0.0-preview2-005840/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-002061-00
  Build    : 2b70ec9c3b014af0c2a5f45de0e5b73a1ae51c09

Diagnostic info

Here are the snippets from dotnet run with export COREHOST_TRACE=1 for netcoreapp1.0 and netcoreapp2.0. It looks like dotnet is trying to resolve NewtonSoft.Json from a package directory with incorrect case for netcoreapp1.0 when compared to netcoreapp2.0.

netcoreapp1.0 (complete log)

Adding tpa entry: /tmp/trial/bin/Debug/netcoreapp1.0/trial.dll
Processing TPA for deps entry [Newtonsoft.Json, 9.0.1, lib/netstandard1.0/Newtonsoft.Json.dll]
  Considering entry [Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll] and probe dir [/home/armahapa/src/vstest/tools/dotnet/shared/Microsoft.NETCore.App/1.0.4]
    Skipping... probe in deps json failed
  Considering entry [Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll] and probe dir [/home/armahapa/src/vstest/packages]
    Relative path query did not exist /home/armahapa/src/vstest/packages/Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll
    Skipping... not found in probe dir
  Considering entry [Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll] and probe dir [/home/armahapa/.dotnet/NuGetFallbackFolder]
    Relative path query did not exist /home/armahapa/.dotnet/NuGetFallbackFolder/Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll
    Skipping... not found in probe dir
    Local path query did not exist /tmp/trial/bin/Debug/netcoreapp1.0/Newtonsoft.Json.dll

netcoreapp2.0 (complete log)

Adding tpa entry: /tmp/trial/bin/Debug/netcoreapp2.0/trial.dll
Processing TPA for deps entry [Newtonsoft.Json, 9.0.1, lib/netstandard1.0/Newtonsoft.Json.dll]
  Considering entry [Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll] and probe dir [/home/armahapa/src/vstest/tools/dotnet/shared/Microsoft.NETCore.App/2.0.0-preview1-002061-00]
    Skipping... probe in deps json failed
    Skipping... not found in probe dir '/home/armahapa/src/vstest/tools/dotnet/shared/Microsoft.NETCore.App/2.0.0-preview1-002061-00'
  Considering entry [Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll] and probe dir []
    Local path query did not exist /tmp/trial/bin/Debug/netcoreapp2.0/Newtonsoft.Json.dll
    Skipping... probe in deps dir '/tmp/trial/bin/Debug/netcoreapp2.0/' failed
    Skipping... not found in probe dir ''
  Considering entry [Newtonsoft.Json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll] and probe dir [/home/armahapa/src/vstest/packages]
    Relative path query exists /home/armahapa/src/vstest/packages/newtonsoft.json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll
    Probed package dir and matched '/home/armahapa/src/vstest/packages/newtonsoft.json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll'
Adding tpa entry: /home/armahapa/src/vstest/packages/newtonsoft.json/9.0.1/lib/netstandard1.0/Newtonsoft.Json.dll
@livarcocc

This comment has been minimized.

Copy link
Member

livarcocc commented Apr 24, 2017

@eerhardt This seems like a regression in the DependencyModel, probably due to casing differences between 2.0 and 1.0.

Can you take a look?

@livarcocc livarcocc added this to the 2.0.0 milestone Apr 24, 2017

@eerhardt

This comment has been minimized.

Copy link
Member

eerhardt commented Apr 24, 2017

This change was correcting the "toLower" hack in the DependencyModel. On case-sensitive machines, the 2.0 SDK will be broken with shared frameworks v1.0.0-1.0.4. The bug is fixed in v1.0.5. See dotnet/core-setup#1559.

If you want to test it out, you can install the 1.0.5-servicing-004880-00 pre-release version of 1.0.5.

@eerhardt eerhardt closed this Apr 24, 2017

codito added a commit to codito/vstest that referenced this issue Apr 25, 2017

Use netcoreapp 1.0.5 shared runtime.
Fixes an issue in case-sensitive OS where packages are not located
with netcoreapp2.0 sdk and 1.0.4 runtime. See dotnet/cli#6390.

codito added a commit to Microsoft/vstest that referenced this issue Jun 5, 2017

Use netcoreapp 1.0.5 shared runtime. (#752)
* Use netcoreapp 1.0.5 shared runtime.

Fixes an issue in case-sensitive OS where packages are not located
with netcoreapp2.0 sdk and 1.0.4 runtime. See dotnet/cli#6390.

* Update build.ps1

* Update build.sh

* Update build.ps1

* Update build.sh

* Fix flaky test in datacollector attachments manager.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment