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

Impossible to load assembly or file using dotnet-migrate-2019 v 4.1 #256

Open
MaherJendoubi opened this issue Jul 22, 2019 · 12 comments
Open

Comments

@MaherJendoubi
Copy link

Hi,

I run the following command :
dotnet-migrate-2019 migrate "path/to/mysolution/mysolution.sln"

I get the following message : Impossible to load file or assembly ''Microsoft.Extensions.Logging.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'".

How can I solve this issue?

Best regards,
Maher

@andrew-boyarshin
Copy link
Collaborator

andrew-boyarshin commented Jul 23, 2019

Did you install this as NuGet global tool or from ZIP package from releases?

@andrew-boyarshin
Copy link
Collaborator

I'm afraid I can't reproduce the issue under neither Windows (.NET Core 3.0/.NET Framework 4.8) nor Linux (.NET Core 2.2) using both global tool from NuGet and ZIP package from releases. Please, add more information to the issue.

  1. Installation source
  2. OS & OS Version
  3. dotnet --info
  4. Installed .NET Framework version if on Windows

And more detailed reproduction steps would be nice to have.

@MaherJendoubi
Copy link
Author

Hi Andrew,

  1. I am using the ZIP package from releases.
  2. OS Win 7 and Win 10.
  3. λ dotnet --info
    SDK .NET Core (reflétant tous les global.json) :
    Version: 3.0.100-preview6-012264
    Commit: be3f0c1a03

Environnement d'exécution :
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview6-012264\

Host (useful for support):
Version: 3.0.0-preview6-27804-01
Commit: fdf81c6faf

.NET Core SDKs installed:
3.0.100-preview6-012264 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0-preview6.19307.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0-preview6-27804-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview6-27804-01 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
4. .NET Framework 4.7.2 and .NET 4.8

@MaherJendoubi
Copy link
Author

MaherJendoubi commented Jul 23, 2019

To reproduce the issue I cd to the ZIP package then I cd to net461.

I wrote the following command :
dotnet-migrate-2019 wizard "path/to/solution.sln"

@andrew-boyarshin
Copy link
Collaborator

andrew-boyarshin commented Jul 24, 2019

Thanks, I've reproduced the issue. I'll look into it.

upd: my dev local builds do not exhibit the issue.
upd: it appears this is a bug in .NET Core 3 SDK. dotnet-migrate-2019.exe.config is not generated properly (less assembly redirection entries than there should be). I'm always using latest nightlies of SDK, that's why on local tests I've been unable to detect issue before public release. It also means this bug is fixed some time after preview6.
upd: replacing .config file from the released version with the one from my dev builds fixes the issue for the released binaries.

andrew-boyarshin added a commit that referenced this issue Jul 24, 2019
andrew-boyarshin added a commit that referenced this issue Jul 24, 2019
andrew-boyarshin added a commit that referenced this issue Jul 24, 2019
@andrew-boyarshin
Copy link
Collaborator

@MaherJendoubi could you please confirm the issue to be fixed in 4.1.1?

@MaherJendoubi
Copy link
Author

@andrew-boyarshin No, I have now another exception.

@MaherJendoubi
Copy link
Author

image

@CedricLeblond
Copy link

CedricLeblond commented Jul 26, 2019

hi,
Dependencies libraries of Project2015To2017.Core.dll are not contained in Project2015To2017 nuget package (which itself declare no package dependencies). It could explain why System.Memory.dll is not found (at least when using Project2015To21017.nupkg in a console app).

PS : I'm also missing Project2015To2017.Migrate2019.Library.dll into Project2015To2017 nuget package

@andrew-boyarshin
Copy link
Collaborator

There are multiple builds with different issues:

  • dotnet global tool — always ideal and tested extensively to work everywhere
  • netcoreapp2.1 from ZIP releases — always ideal, tested on free time basis
  • net461 from ZIP releases — issues with assembly versions (redirections are not being generated due to 3.0 Preview Microsoft.NET.Sdk bug, so, despite the existence of correct assembly file, it's not being picked due to version mismatch), this is what this issue is about
  • All NuGet libraries — issues with dependencies due to another NuGet bug (or, rather, incomplete functionality with Priority 1 issue on their backlog), sometimes workarounds work

@CedricLeblond regarding Project2015To2017.Migrate2019.Library absence in Project2015To2017 — I'm aware of that, that is easy to fix.

@reegeek
Copy link

reegeek commented Sep 2, 2019

hi,
A nuget package which fix this issue, is it available ?

Regards.

@reegeek
Copy link

reegeek commented Sep 4, 2019

the nuspec generate have some dependency to other pacakges which are not publishing:

      <group targetFramework=".NETStandard2.0">
        <dependency id="Project2015To2017.Core" version="4.1.1" exclude="Build,Analyzers" />
        <dependency id="Project2015To2017.Migrate2017.Library" version="4.1.1" exclude="Build,Analyzers" />
      </group>

so if you also publish all nupkg create in the repository everything should be working.

Regards.

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