Skip to content
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 #8157

Closed
codito opened this issue Apr 24, 2017 · 2 comments
Milestone

Comments

@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
Copy link
Contributor

@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?

@eerhardt
Copy link
Member

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 https://github.com/dotnet/core-setup/issues/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.

codito referenced this issue in codito/vstest Apr 25, 2017
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 referenced this issue in microsoft/vstest Jun 5, 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.

* Update build.ps1

* Update build.sh

* Update build.ps1

* Update build.sh

* Fix flaky test in datacollector attachments manager.
@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants