问题描述
在编译项目时,我会提示以下警告:
警告1至少'CorRuntimeHost.SwitchOutLogicalThreadState'的参数之一不能被运行时封送处理程序封送处理.因此,此类参数将作为指针传递,并且可能需要不安全的代码进行操作.
警告2至少'ICorRuntimeHost.SwitchOutLogicalThreadState'的参数之一不能被运行时封送处理程序封送处理.因此,此类参数将作为指针传递,并且可能需要不安全的代码进行操作.
警告3类型库导入程序无法转换成员'tag_VerError.item1_data'的签名.
警告4 ;类型库导入程序无法转换成员'tag_VerError.item2_data'的签名.
我直接在项目中引用的标准库是:
. < ItemGroup>
<参考包括="EnvDTE,版本= 8.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a"<
< SpecificVersion> False</SpecificVersion>
< EmbedInteropTypes> True</EmbedInteropTypes>
< HintPath> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ PublicAssemblies \ EnvDTE.dll</HintPath>
</Reference>
<参考包括="EnvDTE100,版本= 10.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a"<
< SpecificVersion> False</SpecificVersion>
< EmbedInteropTypes> True</EmbedInteropTypes>
< HintPath> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ PublicAssemblies \ EnvDTE100.dll</HintPath>
</Reference>
<参考包括="EnvDTE80,版本= 8.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a"<
< SpecificVersion> False</SpecificVersion>
< EmbedInteropTypes> True</EmbedInteropTypes>
< HintPath> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ PublicAssemblies \ EnvDTE80.dll</HintPath>
</Reference>
<参考包括="EnvDTE90,版本= 9.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a"<
< SpecificVersion> False</SpecificVersion>
< EmbedInteropTypes> True</EmbedInteropTypes>
< HintPath> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ PublicAssemblies \ EnvDTE90.dll</HintPath>
</Reference>
<参考包括="EnvDTE90a,版本= 9.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a"<
< SpecificVersion> False</SpecificVersion>
< EmbedInteropTypes> True</EmbedInteropTypes>
< HintPath> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ PublicAssemblies \ EnvDTE90a.dll</HintPath>
</Reference>
<参考包括="Microsoft.CSharp"; />
<参考包含="Microsoft.VisualStudio.QualityTools.UnitTestFramework,版本= 10.0.0.0,文化=中性,PublicKeyToken = b03f5f7f11d50a3a,processorArchitecture = MSIL" < SpecificVersion> False</SpecificVersion>
< HintPath> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ PublicAssemblies \ Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath>
</Reference>
<参考包括=系统"; />
<参考包含="System.Core">
< RequiredTargetFramework> 3.5</RequiredTargetFramework>
</Reference>
<参考Include ="System.Data"; />
<参考包括="System.Drawing". />
<参考包含="System.Windows.Forms". />
< Reference Include ="System.Xml"; />
</ItemGroup>
关于,
Dawid Ireno
When compiling my project I egt the following warnings:
Warning 1 At least one of the arguments for 'CorRuntimeHost.SwitchOutLogicalThreadState' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning 2 At least one of the arguments for 'ICorRuntimeHost.SwitchOutLogicalThreadState' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
Warning 3 The type library importer could not convert the signature for the member 'tag_VerError.item1_data'.
Warning 4 The type library importer could not convert the signature for the member 'tag_VerError.item2_data'.
Standard libraries I refference directly in my project are:
<ItemGroup>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\EnvDTE.dll</HintPath>
</Reference>
<Reference Include="EnvDTE100, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\EnvDTE100.dll</HintPath>
</Reference>
<Reference Include="EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\EnvDTE80.dll</HintPath>
</Reference>
<Reference Include="EnvDTE90, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\EnvDTE90.dll</HintPath>
</Reference>
<Reference Include="EnvDTE90a, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>True</EmbedInteropTypes>
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\EnvDTE90a.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
Regards,
Dawid Ireno
推荐答案
警告1& 2几乎说系统不知道如何编组参数 这些函数,所以它将只传递一个指针.当函数采用系统编组部分不知道的参数时,可能会发生这种情况.我想这意味着它更不安全,因为您不知道另一个 结束将与指针有关,但如果它起作用,则可以忽略该消息.
The warning 1 & 2 is pretty much saying that the system doesn't know how to marshal the parameters to those functions, so it will just pass a pointer. This probably happens when the functions take a parameter that the marshalling part of the system doesn't know about. I guess this means that it is a bit more unsafe, in that you don't know what the other end is going to do with the pointer, but if it works, its probably OK to ignore the message.
这篇关于运行时编组器和库导入器警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!