CsprojToVs2017 icon indicating copy to clipboard operation
CsprojToVs2017 copied to clipboard

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

Open MaherJendoubi opened this issue 4 years ago • 12 comments

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

MaherJendoubi avatar Jul 22 '19 17:07 MaherJendoubi

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

andrew-boyarshin avatar Jul 23 '19 02:07 andrew-boyarshin

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.

andrew-boyarshin avatar Jul 23 '19 02:07 andrew-boyarshin

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 avatar Jul 23 '19 07:07 MaherJendoubi

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"

MaherJendoubi avatar Jul 23 '19 08:07 MaherJendoubi

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 avatar Jul 24 '19 12:07 andrew-boyarshin

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

andrew-boyarshin avatar Jul 24 '19 16:07 andrew-boyarshin

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

MaherJendoubi avatar Jul 25 '19 04:07 MaherJendoubi

image

MaherJendoubi avatar Jul 25 '19 04:07 MaherJendoubi

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

CedricLeblond avatar Jul 26 '19 12:07 CedricLeblond

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.

andrew-boyarshin avatar Jul 26 '19 18:07 andrew-boyarshin

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

Regards.

reegeek avatar Sep 02 '19 08:09 reegeek

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.

reegeek avatar Sep 04 '19 08:09 reegeek