Windows 8 앱에서 사용할 Windows 런타임 구성 요소를 만들려고합니다.Windows 런타임 구성 요소 컴파일시 Windows Metadata Exporter가 충돌 함
이것은 본질적으로 helloworld 수준의 응용 프로그램이므로 아무 것도 복잡하지 않습니다. 나는이 문제를 복제 할 필요가있는 유일한 것은 다음과 같은 방법 중 한 쌍을 포함하는 것입니다 : 내가 프로젝트를 컴파일 할 때마다
public IAsyncOperation<string[]> GetThings()
{
return GetThingsAsync().AsAsyncOperation();
}
private async Task<string[]> GetThingsAsync()
{
return new List<string>().ToArray();
}
를, 윈도우 메타 데이터 내보내기가 충돌합니다.
빌드 정보를 늘림으로써 출력 창에서 생성 된 오류를 파헤 쳤습니다. "내보내기 'obj \ Debug \ HelloWorld.Logic.winmdobj'다음에 오류가 발생하는 것을 발견했습니다."
동일한 매개 변수를 사용하여 명령 줄에서 winmdexp.exe를 실행하면 System.Xml 파일의 메타 데이터를 찾는 데 문제가있는 것으로 보입니다. (경고 WME0004 : C : \ Program Files (x86) \ ReferenceAssemblies \ Microoft \ Framework.NETCore \ v4.5.1 \ System.Xml.Serialization.dll '참조 된 메타 데이터를 찾을 수 없습니다.)
전체 스택 추적 오류는 다음과 같습니다.
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Tools.WinMDExp.AssemblyReferenceExtensionMethods.IsWindowsRuntimeMetadata(IAssemblyReference assembly)
at Microsoft.Tools.WinMDExp.ExportVisitor.IsWindowsRuntimeType(ITypeReference type, Boolean allowGenericParam)
at Microsoft.Tools.WinMDExp.ExportValidator.<>c__DisplayClasse.<GetAlternativeTypes>b__8(<>f__AnonymousType0`2 <>h__TransparentIdentifier5)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
at Microsoft.Tools.WinMDExp.ExportValidator.GetAlternativeTypes(ITypeReference parameterType, IMethodDefinition containingMethod, Boolean& isTask, Boolean allowGenericTypeParam)
at Microsoft.Tools.WinMDExp.ExportValidator.GetAlternativesTypesForGenericTypes(IGenericTypeInstanceReference parameterType, IMethodDefinition containingMethod, String& errorMsg)
at Microsoft.Tools.WinMDExp.ExportValidator.CheckAlternateTypes(ITypeReference parameterType, IMethodDefinition containingMethod, Boolean& reportedError)
at Microsoft.Tools.WinMDExp.ExportValidator.ValidateExportParameterType(IMethodDefinition containingMethod, ITypeReference parameterType, Boolean& reportedError)
at Microsoft.Tools.WinMDExp.ExportValidator.ValidateExportMethod(IMethodDefinition method)
at Microsoft.Tools.WinMDExp.ExportValidator.TraverseChildren(IMethodDefinition method)
at Microsoft.Cci.MetadataTraverser.Traverse(IMethodDefinition method)
at Microsoft.Cci.MetadataTraverser.Traverse(IEnumerable`1 methods)
at Microsoft.Cci.MetadataTraverser.TraverseChildren(ITypeDefinition typeDefinition)
at Microsoft.Tools.WinMDExp.ExportValidator.TraverseChildren(ITypeDefinition typeDefinition)
at Microsoft.Cci.MetadataTraverser.TraverseChildren(INamedTypeDefinition namedTypeDefinition)
at Microsoft.Tools.WinMDExp.ExportValidator.TraverseChildren(INamespaceTypeDefinition namespaceTypeDefinition)
at Microsoft.Cci.MetadataTraverser.Traverse(INamespaceTypeDefinition namespaceTypeDefinition)
at Microsoft.Cci.MetadataTraverser.Dispatcher.Visit(INamespaceTypeDefinition namespaceTypeDefinition)
at Microsoft.Cci.MetadataReader.ObjectModelImplementation.NamespaceType.Dispatch(IMetadataVisitor visitor)
at Microsoft.Tools.WinMDExp.ExportValidator.Validate(ITypeDefinition type)
at Microsoft.Tools.WinMDExp.ExportValidator.TraverseChildren(IModule module)
at Microsoft.Cci.MetadataTraverser.TraverseChildren(IAssembly assembly)
at Microsoft.Tools.WinMDExp.ExportValidator.TraverseChildren(IAssembly assembly)
at Microsoft.Cci.MetadataTraverser.Traverse(IAssembly assembly)
at Microsoft.Tools.WinMDExp.ExportVisitor.Export(IAssembly assembly)
at Microsoft.Tools.WinMDExp.Exporter.Export()
at Microsoft.Tools.WinMDExp.Program.Main(String[] args)
아무도 무슨 일이 일어나고 있는지, 어떻게 구성 요소를 컴파일 할 수 있는지 생각해 본다면 감사 할 것입니다.
제임스
P. 프로젝트를 동료의 PC로 전송했는데 같은 문제가 발생하여 설정 (Windows 8.1 x64, Visual Studio 2013 Ultimate)과 관련이 있는지 의심 스럽습니다.