Build error with Unity 5.2

I’m getting this error with building WSA universal 10 on Visual Studio Community.

1> Running AssemblyConverter…
1> System.IO.FileNotFoundException: Assembly “Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null” file not found.
1> at Unity.UWPAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
1> at Unity.UWPAssemblyResolver.Resolve(AssemblyNameReference name)
1> at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
1> at Mono.Cecil.TypeReference.Resolve()
1> at Unity.MetadataContainer.ResolveType(TypeReference type)
1> at Unity.MetadataContainer.GetAssemblyForType(TypeReference type)
1> at Unity.AssemblyWrapper.CreateMethodWrapper(MetadataContainer metadata, TypeWrapper typeWrapper, MethodDefinition method)
1> at Unity.AssemblyWrapper.GetCallableMethods(TypeWrapper typeWrapper, TypeDefinition type, Boolean publicOnly)
1> at Unity.AssemblyWrapper.AddType(TypeReference type)
1> at Unity.GetTypesStep.Visit(TypeDefinition type)
1> at Unity.TypeDefinitionDispatcher.DispatchType(TypeDefinition type)
1> at Unity.TypeDefinitionDispatcher…ctor(ModuleDefinition module, ITypeDefinitionVisitor visitor)
1> at Unity.GetTypesStep.ProcessModule()
1> at Unity.ModuleStep.Execute()
1> at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
1> at Unity.Operation.Execute()
1> at Unity.Program.Main(String[ ] args)

Is that latest 5.2 build ?

Do you have Visual Studio 2015 RTM installed ? Because the build won’t work with Visual Studio 2015 RC installed.

In Help->About, it should say 14.0.23107.0

Yes. I’m using Unity 5.2.0f3.

With
Microsoft Visual Studio Community 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00079

Installed Version: Community

Visual Basic 2015 00322-20000-00000-AA502
Microsoft Visual Basic 2015

Visual C# 2015 00322-20000-00000-AA502
Microsoft Visual C# 2015

Visual C++ 2015 00322-20000-00000-AA502
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU 00322-20000-00000-AA502
Windows Phone SDK 8.0 - ENU

Visual Studio Tools for Universal Windows Apps 14.0.23121.00 D14OOB

Could you please submit a bug report with repro case attached?

Another idea, maybe you’re using a plugin which was targeting Windows 8.1 SDK ?

I created an empty project unity and wrote a simple plugin for windows universal like this link https://mix.office.com/watch/qqsyfebysgrj
but a got a same error when build universal 10:
UnityException: Failed to run assembly converter with command -metadata=0 -platform=uap -lock=“project.lock.json” Temp\StagingArea\Assembly-CSharp.dll.
System.IO.FileNotFoundException: Assembly “Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null” file not found.
at Unity.UWPAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Unity.UWPAssemblyResolver.Resolve(AssemblyNameReference name)
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at Unity.ModuleContext.Retarget(TypeReference type, GenericContext context)
at Unity.ModuleContext.Retarget(MethodReference method, GenericContext context)
at Unity.FixReferencesStep.Visit(MethodDefinition method, GenericContext context)
at Unity.FixReferencesStep.Visit(TypeDefinition type)
at Unity.TypeDefinitionDispatcher.DispatchType(TypeDefinition type)
at Unity.TypeDefinitionDispatcher…ctor(ModuleDefinition module, ITypeDefinitionVisitor visitor)
at Unity.FixReferencesStep.ProcessModule()
at Unity.ModuleStep.Execute()
at Unity.FixReferencesStep.Execute()
at Unity.Step.Execute(OperationContext operationContext, IStepContext previousStepContext)
at Unity.Operation.Execute()
at Unity.Program.Main(String[ ] args)

PostProcessUAP.RunAssemblyConverterNoMetadata (System.String assembly, System.String projectLockFile) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessUAP.cs:57)
PostProcessWinRT.RunReferenceRewriter () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:547)
PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:118)
UnityEditor.Metro.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:99)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()

It cannot find Test.dll. Are you sure you didn’t mark it as “don’t process”? Because you shouldn’t.

No, I don’t mark “don’t process”

.

We are having the exact same problem. Any ideas? :slight_smile:

Could we get a bug report on this? I don’t think we’ve been able to reproduce the issue internally yet. Is Test.dll present in \temp\stagingarea when this error occurs? If not, could you try setting the plugin to “AnySDK” rather than UWP? Maybe there some kind of issue that prevents the DLL from getting copied.

1 Like

It worked. Thanks for your support :slight_smile:

Another problem. I added Facebook SDK in my plugin, but when building complete, I don’t have Facebook.dll . And then I got this error when build Universal 10 in Unity:

UnityException: Failed to run reference rewriter with command --target=“Temp\StagingArea\TestPlugin.dll” --additionalreferences=“Temp\StagingArea” --platform=“C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd” --support=“Temp\StagingArea\WinRTLegacy.dll” --supportpartialns=Unity.Partial --system=System --dbg=pdb --lock=project.lock.json --alt=System.Xml.Serialization;System.Collections,System.Collections.NonGeneric;System.Reflection,System.Reflection.TypeExtensions --ignore=System.IConvertible,mscorlib.
Catastrophic failure while running rrw: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: ‘Windows.Foundation.UniversalApiContract, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’
at Unity.ReferenceRewriter.SearchPathAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Unity.ReferenceRewriter.NuGetAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at Unity.ReferenceRewriter.RewriteTypeReferences.Visit(TypeReference type, String referencingEntityName)
at Unity.ReferenceRewriter.ReferenceDispatcher.DispatchFields(TypeDefinition type, String referencingEntityName)
at Unity.ReferenceRewriter.ReferenceDispatcher.Dispatch(TypeDefinition type)
at Unity.ReferenceRewriter.ReferenceDispatcher.Dispatch()
at Unity.ReferenceRewriter.RewriteTypeReferences.Run()
at Unity.ReferenceRewriter.RewriteOperation.Execute(RewriteContext context)
at Unity.ReferenceRewriter.Program.Main(String[ ] args)

PostProcessWinRT.RunReferenceRewriter () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:543)
PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:118)
UnityEditor.Metro.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:99)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316)
UnityEditor.HostView:OnGUI()

By the way, we’re getting the same error as gamePig, where it says “System.IO.FileNotFoundException: Assembly “Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null” file not found.”

“Windows” isn’t our plugin/assembly, is it? We’ve marked all our WSA plugins as “Any SDK”, but it doesn’t make a difference, because it’s probably some internal assembly that isn’t copied?

Windows assembly is a part of Window SDK, but I am not sure if it doesn’t find Windows assembly from Windows 8.1 SDK or Windows 10 SDK, could we please get a bug report on this?

Done. Case number: 726816

It seems that the bug hasn’t been tested yet, but even if you haven’t seen the reproduction project, maybe you could give us some ideas, what we could try to work around the issue? We would greatly appreciate it! :slight_smile:

Looking at the bug now, seems I can reproduce it with your repro case, stay tuned

It really is a bug on our side, here’s a workaround you can try:

  • Copy C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.wimd to your exported project directory, next to project.json, it should fix error where it doesn’t find Windows.winmd.

I still got errors after that related to your plugin, but it’s up to you to fix those.

Hope that helps

1 Like

I tried, but It still got the same error

It worked for us, thank you very much!

Thien Le, please submit a bug with repro project attached, it maybe you’re hitting a different bug. And post case number here