Reputation: 22074
I am getting strange warnings out of Visual Studio 2008 when compiling a C# ASP.NET application. Could anyone point me to an explanation (in words of few syllables, if possible) of what this warning means?
At least one of the arguments for 'IasHelper.Process' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Upvotes: 18
Views: 12749
Reputation: 35430
Just in case this helps someone and a future note to myself, if you're building a VSTO add-io, make sure there are no unnecessary COM DLLs referenced by your project. In my case, I had ExcelAdaptorLib
added in the References
section. Removing it got rid of all the 18 warnings and I now have a clean build.
Upvotes: 0
Reputation: 2073
Sounds like you're referencing an ActiveX object and its giving the tlbimp.exe a tough time marshaling the arguments of some of the methods and structure members between COM and .NET.
this maybe happening during clean builds as that's the only time tlbimp has to run. try to do a normal build where you didn't not clean first.
Upvotes: 9
Reputation: 4323
The Marshal class is responsible to convert unmanaged code/classes to managed classes and vice versa. See the msdn documentation of the Marshal Class.
If you include some interop assembly to access COM object or such it may happen that the Marshal(l)er cannot take care of the operation. Thus you have quasi-unmanaged parts running in your program which in turn can cause nasty things like buffers overruns and such. You thereby leave the safe, cozy world of managed code and enter the drafty, dangerous realm of C/C++ and their dreaded brethren. :-)
Upvotes: 11