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

Failed to resolve assembly... #127

Closed
esso23 opened this issue Dec 9, 2019 · 2 comments
Closed

Failed to resolve assembly... #127

esso23 opened this issue Dec 9, 2019 · 2 comments
Milestone

Comments

@esso23
Copy link

esso23 commented Dec 9, 2019

Hi,

I have a problem when using latest version with .NET Standard 2.1 (same problem occurs when I use .NET Core 3.1).
The error happens when building:

'Failed to resolve assembly: 'dllexport_issue.dep, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' dllexport_issue D:\Sync\Projects\dllexport_issue\packages\DllExport.1.7.0-beta\tools\net.r_eg.DllExport.targets 74'

Basically I have ClassLibrary1 referencing ClassLibrary2 and in some cases DllExport cannot resolve ClassLibrary2 assembly when creating exports for ClassLibrary1.
I tried to isolate the problem and the build task fails when there is an Attribute that has an Enum property which is initialized in Attribute constructor (not sure that's the ACTUAL problem, but when I was adding things one by one, that's where it broke). See attached repro.

  • -version: v1.7-beta
  • Project type: 64-bit netstandard 2.1
  • Environment ( VS, MSBuild, ...): Visual Studio 16.4, MSBuild, Windows 10 Pro, .NET Core 3.1 SDK

Here is complete solution with minimum repro. Just compile 'dllexport_issue' project and error occurs:
'Failed to resolve assembly: 'dllexport_issue.dep, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' dllexport_issue D:\Sync\Projects\dllexport_issue\packages\DllExport.1.7.0-beta\tools\net.r_eg.DllExport.targets 74 '
dllexport_issue.zip

Edit: Maybe it's worth to note I am porting code to .NET Standard 2.1 from .NET Framework 4.7.2 where I was also using DllExport (1.6.5) and everything worked fine.

@esso23 esso23 added the bug label Dec 9, 2019
@3F
Copy link
Owner

3F commented Dec 9, 2019

Confirm. Thanks for the report and attached sample!

.NET Framework 4.7.2 where I was also using DllExport (1.6.5) and everything worked fine.

Yes, please use this before fixing problem. I'll try to review issue for 1.7 beta2.

@3F 3F added this to the 1.7 milestone Dec 9, 2019
3F added a commit that referenced this issue Dec 13, 2019
* FIXED: Fixed possible "Invalid memory access" (JNA/Java). Issue #125.
         For C/C++ such as "Unhandled exception at ... (KernelBase)"

         https://twitter.com/GitHub3F/status/1201904821093187585

* FIXED: Fixed 'Failed to resolve assembly...' when .NET Standard. Issue #127.

* FIXED: Fixed error when switching between .sln in UI. Wizard.

* FIXED: Fixed possible duplication of `PlatformTarget` during setup.

* NEW: Implemented "Rebase System Object" option for our assembler.

* CHANGED: New installation behavior through official NuGet.

* CHANGED: New wizard layout for 1.7.

* CHANGED: Updated CoreCLR 3.1.0 RTM \ IL Assembler 4.700.2.
           https://github.com/3F/coreclr/releases/tag/ILAsm.4.700.2

           Includes an implemented `/REBASE` feature for related issue #125.

* CHANGED: Updated Mono Cecil 0.11.1
           https://github.com/jbevain/cecil/releases/tag/0.11.1

* CHANGED: Updated Conari 1.4
           https://github.com/3F/Conari/releases/tag/1.4

* KNOWN: Possible syntax error at token 'inf'. Issue #128.
         #128

* KNOWN: You can finally get another System.Object in modified assembly:
         #90 (comment)

* NOTE: Please don't use beta releases in production!

* NOTE: Please report about something here: https://github.com/3F/DllExport/issues
@3F
Copy link
Owner

3F commented Dec 15, 2019

Please test applied solution through latest beta releases.

@3F 3F closed this as completed Dec 15, 2019
@3F 3F added the netcore label Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants