Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
非托管导出(DllExport for.NET)和MSBuild错误_Msbuild_Managed_Nuget Package_Dllexport - Fatal编程技术网

非托管导出(DllExport for.NET)和MSBuild错误

非托管导出(DllExport for.NET)和MSBuild错误,msbuild,managed,nuget-package,dllexport,Msbuild,Managed,Nuget Package,Dllexport,我已经安装了Nuget package“非托管导出”(dllExport for.NET)。使用MS Visual Studio 2010可以很好地工作 使用MSBuild(Windows SDK v7.1)时,我得到一个错误索引(从零开始)必须大于或等于零且小于参数列表的大小。 你知道怎么解决这个问题吗 部分MSBuild输出: MethodDeclarationParserAction: Found method: HSAdapter.HSAdapter..method public hid

我已经安装了Nuget package“非托管导出”(dllExport for.NET)。使用MS Visual Studio 2010可以很好地工作

使用MSBuild(Windows SDK v7.1)时,我得到一个错误
索引(从零开始)必须大于或等于零且小于参数列表的大小。

你知道怎么解决这个问题吗

部分MSBuild输出:

MethodDeclarationParserAction: Found method: HSAdapter.HSAdapter..method public hidebysig static void  'CreateHSAdapterInstance'([out] class 'HSAdapter'.'IHSAdapter'&  marshal( interface ) 'instance') cil managed
MethodPropertiesParserAction: Removing RGiesecke.DllExport.DllExportAttribute from HSAdapter.HSAdapter.CreateHSAdapterInstance
DeleteExportAttributeParserAction: Adding .vtentry:0 .export:CreateHSAdapterInstance
Parse IL: Deleting unused reference to RGiesecke.DllExport.Metadata.
Parse IL: Parsing 1676 lines of IL took 51 ms.
D:\HS4\packages\UnmanagedExports.1.2.4.23262\tools\RGiesecke.DllExport.targets(42,5): error : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at RGiesecke.DllExport.DllExportNotifier.Notify(Int32 severity, String code, String fileName, Nullable`1 startPosition, Nullable`1 endPosition, String message, Object[] values) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportNotifier.cs:line 135
at RGiesecke.DllExport.DllExportNotifier.Notify(Int32 severity, String code, String message, Object[] values) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportNotifier.cs:line 119
at RGiesecke.DllExport.Parsing.DllExportNotifierWrapper.Notify(Int32 severity, String code, String message, Object[] values) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\DllExportNotifierWrapper.cs:line 41
at RGiesecke.DllExport.Parsing.IlAsm.RunLibTool(CpuPlatform cpu, String fileName, String directory) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:line 212
at RGiesecke.DllExport.Parsing.IlAsm.RunCore(CpuPlatform cpu, String fileName, String ressourceParam, String ilSuffix) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:line 186
at RGiesecke.DllExport.Parsing.IlAsm.Run(String outputFile, String ilSuffix, CpuPlatform cpu) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:line 123
at RGiesecke.DllExport.Parsing.IlAsm.ReassembleFile(String outputFile, String ilSuffix, CpuPlatform cpu) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\Parsing\ILAsm.cs:line 75
at RGiesecke.DllExport.DllExportWeaver.RunIlAsm(IlAsm ilAsm) in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportWeaver.cs:line 151
at RGiesecke.DllExport.DllExportWeaver.Run() in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport\DllExportWeaver.cs:line 81
at RGiesecke.DllExport.MSBuild.ExportTaskImplementation`1.Execute() in d:\Work\Libraries\RGiesecke.DllExport\RGiesecke.DllExport.MSBuild\ExportTaskImplementation.cs:line 243
Done Building Project "D:\HS4\HSAdapter\HSAdapter.csproj" (default targets) -- FAILED.

我刚刚遇到了同样的问题。RGiesecke.DllExport.targets文件引用$(DevEnvDir),它不会在运行msbuild的环境中定义(但将从Visual Studio中定义)。我采取了快速而肮脏的方法,在生成服务器上添加了一个系统范围的环境变量(设置为“C:\Program Files(x86))\Microsoft Visual Studio 11.0\Common7\IDE\”)来解决这个问题,因为我很忙。

您能更好地解释一下您是如何解决这个问题的吗?我可以试试,但我不确定哪个部分不清楚。我添加了一个名为“DevEnvDir”的Windows系统变量,其值为“C:\Program Files(x86)\Microsoft Visual Studio 11.0\Common7\IDE”\“.Windows系统变量可以通过控制面板->系统->高级系统设置->高级->环境变量进行设置。