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

decompile fails when referencing ef core 5 #2232

Closed
kellcomnet2 opened this issue Nov 27, 2020 · 8 comments · Fixed by #2235
Closed

decompile fails when referencing ef core 5 #2232

kellcomnet2 opened this issue Nov 27, 2020 · 8 comments · Fixed by #2235
Labels

Comments

@kellcomnet2
Copy link

Steps to reproduce

  1. .net5-windows console app
  2. When using the Nuget package, attempting to decompile the dll fails if I reference Microsoft.EntityFrameworkCore.Design v5.0.0

Error message shown

2020-11-26 08:41:50.9478|1 |ERROR|JobLogic.ProcessIso|Error in ProcessIso: '*************'. Error decompiling @06000004 ININ.WebServices.Core.HeaderUtilities.ApplyHeadersToRequest
2020-11-26 08:41:50.9760|1 |ERROR|JobLogic.ProcessIso|   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in offset 833
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(IMethod method, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in offset 292
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(ITypeDefinition typeDef, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in offset 648
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompileTypes(IEnumerable`1 types, DecompileRun decompileRun, ITypeResolveContext decompilationContext, SyntaxTree syntaxTree) in offset 171
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileWholeModuleAsSingleFile(Boolean sortTypes) in offset 139
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileWholeModuleAsSingleFile() in offset 0
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileWholeModuleAsString() in offset 0
   at ****.Logic.DecompileLogic.DecompileIt(String file, String ProjFilePath, String csprojPath, String Version) in DecompileLogic.cs:line 20
   at ****.Logic.Nuget.ProcessICWS_NetStandard(String PackageID, Version Version, DirectoryInfo bin_info) in Nuget.cs:line 385
   at ****.Logic.Nuget.ProcessICWS(String ExtractPath, String PackageID, Version Version) in Nuget.cs:line 144
   at ****.JobLogic.Process_CIC_ICWS_MSI(Version version, String msi) in JobDefinition.cs:line 368
   at ****.JobLogic.ProcessIso(String iso, IsoType isoType) in JobDefinition.cs:line 574 Error decompiling @06000004 ININ.WebServices.Core.HeaderUtilities.ApplyHeadersToRequest

Details

  • Product in use: ICSharpCode.Decompiler nuget package
  • Version in use: 6.2.1.6137
  • Any other relevant information to the issue, or your interest in contributing a fix.
@kellcomnet2
Copy link
Author

@kellcomnet2
Copy link
Author

OK, some additional research on this, ICSharpCode.Decompiler references Humanizer.Core >= 2.2.0 while efcore references Humanizer.Core >= 2.8.26

@siegfriedpammer
Copy link
Member

siegfriedpammer commented Nov 27, 2020

yes, there is a breaking change in Humanizer.Core:

The decompiler expects: System.String Humanizer.InflectorExtensions.Singularize(System.String, Boolean)
The newer Humanizer only offers: System.String Humanizer.InflectorExtensions.Singularize(System.String, Boolean, Boolean).

The breaking change is due to the added optional parameter. Note that both are from the same major version, seems like Humanizer does not follow semver rules... not sure how we could fix this.

@siegfriedpammer
Copy link
Member

Not sure, if updating to a newer version of Humanizer is a good idea. @dgrunwald @christophwille what do you think?

@kellcomnet2
Copy link
Author

Once Humanizer fixes their issue, I wonder how long before ef core pulls in the new package.... sigh.. Thank you for your fast response.

@christophwille
Copy link
Member

https://www.nuget.org/packages/Microsoft.CodeAnalysis.CSharp.Workspaces/

This locks in our dependency, right?

@siegfriedpammer
Copy link
Member

yes, so I guess, Humanizer should fix their bug.

@christophwille
Copy link
Member

fyi, we are considering to copy source the parts of Humanizer (and make internal) we need. That way we could drop the dependency of Humanizer altogether and make the scenarios where a newer version is needed easily possible.

siegfriedpammer added a commit that referenced this issue Nov 29, 2020
…Humanizer. Therefore we copy the relevant parts and remove the dependency in order to avoid such problems in the future.
siegfriedpammer added a commit that referenced this issue Nov 29, 2020
…Humanizer. Therefore we copy the relevant parts and remove the dependency in order to avoid such problems in the future.
siegfriedpammer added a commit that referenced this issue Nov 29, 2020
…Humanizer. Therefore we copy the relevant parts and remove the dependency in order to avoid such problems in the future.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants