2013-06-18 5 views
4

(.NET에 대한 dllExport).이 작동 잘 MSBuild를 (윈도우 SDK의 V7을 사용하여 MS Visual Studio 2010에서 Visual Studio 2010을관리되지 않는 수출 (.NET에 대한 DllExport) 내가 Nuget 패키지 "관리되지 않는 수출을 설치 한 MSBuild에서 오류

를 사용하여. 1) 나는 오류이 해결 될 수있는 방법 Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

어떤 생각을

부분은 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. 

답변

5

방금 ​​같은 문제가 발생했습니다. RGiesecke.DllExport.targets 파일은 $ (DevEnvDir)을 참조합니다.이 파일은 msbuild를 실행하고있는 환경에서는 정의되지 않지만 (Visual Studio 내에서 제공 될 것입니다). 필자는 빌드 서버 ("C : \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE \"로 설정)에서 시스템 전체 환경 변수를 추가하는 빠르고 쉬운 방법을 사용하여 해결했습니다. 서둘러.

+0

이 문제를 어떻게 해결했는지 더 잘 설명 할 수 있습니까? –

+1

시도 할 수 있지만 어느 부분이 불분명한지 확실하지 않습니다. "C : \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE \"값의 "DevEnvDir"이라는 Windows 시스템 변수를 추가했습니다. Windows 시스템 변수는 제어판 -> 시스템 -> 고급 시스템 설정 -> 고급 -> 환경 변수를 통해 설정할 수 있습니다. –

관련 문제