Strange warnings in VS

I have a lot of warnings like this and I have no idea what they mean.

Does anyone know what it is?

β€œAt least one of the arguments toβ€œ IOleWindow.GetWindow ”cannot be marshaled by the runtime marshaller. Therefore, such arguments will be passed as a pointer and may require manipulation of unsafe code.”

I should also indicate that it refers to "c: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets"

+6
source share
3 answers

A good explanation of the situation can be found here :

You can safely ignore these warnings. You can learn more about this issue by consulting this page: http://msdn.microsoft.com/en-us/library/aa289520%28v=vs.71%29.aspx

The In-Out C-Style Arrays section is especially important. Bottom line: if the returned buffer of the specified methods in the warnings were set to "in", you would have to apply the changes in the article. But since all of the above methods handle buffers, warnings do not matter to you or to the framework.

However, if you want to get rid of warnings forever (when you do "Rebuild All", for example), you will not have the choice to continue as described in the article. You will have to parse the interop wrapper (with ildasm), edit the IL and compile (with ilasm). This process is also called "creative round trip."

+1
source

You can use the Type Library Importer (tblimp) to import the DLL outside of Visual Studio and use the generated link instead of allowing Visual Studio to create it, hence removing warnings.

+2
source

The main problem with the warning message is that it points only to the project and not to COM, so the removal process seems to be the only way to track this.

0
source

Source: https://habr.com/ru/post/916438/


All Articles