-
Notifications
You must be signed in to change notification settings - Fork 15
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
Invalid mock assembly produced #19
Comments
The problem is that we use |
Not sure what to do about that, honestly. I've tried to get that exception imported first, before everything else, and it failed in if (dstHandle != _typeDefinitionCache[srcHandle])
throw new Exception("WTF: type handle mismatch"); |
As I remember, all methods in mockup mode are replaced with I think that acceptable solution will be to check if NotImplementedException is defined in assembly and return error when trying to mockup such assembly. Or (a little harder to implement) maybe specify exception type (should be from assembly references) to throw. |
Well, technically such an implementation should be valid: class NotImplementedException {
public NotImplementedException() {
throw new NotImplementedException();
}
} It is possible to write and compile in C#, so it has to be possible to express in metadata. But I'm not sure what exact sequence of actions would help us to achieve this. |
What is the reason for using |
Never used and never seen |
Though now I can't remember in what context I saw it. |
I'm generating mock assemblies and then inspecting them with ILSpy. I noticed that in some cases the generated assembly contains methods that can't be processed with ILSpy. I'm unsure if the problem lies in ILSpy or Refasmer. If I generate reference assemblies instead of the mocks, then I'm not facing the issue. Also, not all methods are impacted by the problem in a mock assembly.
The below commands
produce an exception:
From the below two commands, only the latter one is failing, so not all types are impacted:
Removing the
-m
works without any problem:I'm running the above on MacOS. The input DLL is the dotnet 7 reference assembly
System.Runtime.dll
.The text was updated successfully, but these errors were encountered: