-
Notifications
You must be signed in to change notification settings - Fork 471
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
ProxyUtil.AreInternalsVisibleToDynamicProxy does not take into account target assembly's strong-name status #488
Comments
I just noticed two more things:
|
Isn't the problem that you are trying to generate a non strong named dynamic assembly I think there might be a bug in
|
@pakrym, thanks for the hint. It's indeed possible that there is a bug in DynamicProxy... I'll look into it ASAP. |
Ah yes, I think this explains it. What's happening in the above repro code (and in @GeeWee's) is this:
The |
Is there a possible workaround for this? If not, what can I do to help move this forward to a resolution? |
Hello, any news on this issue? I just stubble on this while creating a class inheriting from a BlobContainerClient for the Azure.Storage.Blobs and trying to create a mock based on my class. I can confirm that if a put a strong name on my assembly then mocking is working but this is not an option for us. |
There has been no fix made for this defect. |
It's been a year, any update on this defect. I'm also running into this issue while trying to mock a class inheriting from Azure DataLakeServiceClient. Same exact issue that the devs above are having with BlobContainerClient. |
No, no update. Perhaps a quick explanation why nothing has happened yet (beyond the obvious principal reason that simply noone has submitted a PR for it): compared to other open issues, this has a fairly low priority, because it doesn't affect many common use cases. Also, to get this to work requires an extensive refactoring of pretty much all of DynamicProxy's internal classes... I know because I made an attempt months ago. The necessary changes quickly grew to such proportions that I didn't feel comfortable with a PR at the time. The cost/benefit ratio seemed unfavourable. I deemed it a better idea to first simplify DynamicProxy's internals further, so that this could be solved with fewer code changes. Don't get your hopes up that this will get resolved anytime in the near future. I suggest you try to find a workaround for the time being (possibly by overriding inherited internal members but keeping them overridable, and delegating to the inherited base methods). |
@GeeWee posted a bug report at devlooped/moq#991 which basically boils down to this:
Proxying
BlockBlobClient
appears to work fine; proxying an empty subclass of it throws the following exception:(It may or may not be relevant that PEVerify reports a bunch of invalid signatures in the
netstandard2.0
DLL for that package:The text was updated successfully, but these errors were encountered: