You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ILVerify fails with error [MissingMethod] if call to method uses a parameter with type from an embedded interop assembly #62732
When a call to a method uses a parameter whose type is embedded from an interop assembly, ILVerify fails to verify the dll with:
Error [MissingMethod]
Reproduction Steps
Using Visual Studio 2022 create a .NET Framework (not .NET) Class Library named ClassLibraryInterop
Add the NuGet package Microsoft.VisualStudio.Imaging (version 14.3.25407)
Add the NuGet package Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime (version 14.3.26931). This interop assembly is automatically embedded, which is typical of the Visual Studio SDK used to create VSIX extensions for Visual Studio
Add this code:
using Microsoft.VisualStudio.Imaging.Interop;
using System.Runtime.InteropServices;
namespace ClassLibraryInterop
{
public class Class1
{
void f1()
{
ImageAttributes imageAttributes = new ImageAttributes
{
StructSize = Marshal.SizeOf(typeof(ImageAttributes))
};
Microsoft.VisualStudio.Imaging.ImagingUtilities.ValidateAttributes(imageAttributes);
}
}
}
Build the DLL
Open a command prompt and change to the output folder (ClassLibraryInterop\bin\Debug)
changed the title [-]ILVerify fails with error [MissingMethod] if calls to method uses a parameter with type from an embedded interop assembly[/-][+]ILVerify fails with error [MissingMethod] if call to method uses a parameter with type from an embedded interop assembly[/+]on Dec 13, 2021
Activity
[-]ILVerify fails with error [MissingMethod] if calls to method uses a parameter with type from an embedded interop assembly[/-][+]ILVerify fails with error [MissingMethod] if call to method uses a parameter with type from an embedded interop assembly[/+]JulieLeeMSFT commentedon Jan 26, 2022
cc @TIHan.