Failed to run assembly preprocessor with cmdline error

i get this error. what cause this? must all asset owners change their precompiled libraries to make them compatible with phone 8 and windows store apps?

Error building Player: Exception: Failed to run assembly preprocessor with cmdline “Temp/StagingArea\Data/Managed\EasyRoads3D.dll” -injectCtor -assemblyPath “Temp/StagingArea\Managed” -pdb.[Temp/StagingArea\Data/Managed\EasyRoads3D.dll]
No symbols for Temp/StagingArea\Data/Managed\EasyRoads3D.dll
Injecting ctor
Error while in assembly preprocessor Temp/StagingArea\Data/Managed\EasyRoads3D.dll
The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary2.get_Item(TKey key) at AssemblyPreprocessor.ConstructorInjector.GetBaseConstructorMethodFor(MethodDefinition constructor, Dictionary2 map)
at AssemblyPreprocessor.ConstructorInjector.CreateBodyInvokingBaseConstructor(TypeDefinition parentType, MethodDefinition constructor, Dictionary`2 map)
at AssemblyPreprocessor.ConstructorInjector.InjectConstructorsForTypesIn(ModuleDefinition moduleDefinition)
at AssemblyPreprocessor.Program.Main(String[ ] args)

Where did you put that DLL? What is that DLL (native or .Net and if .Net what version)?

it is a part of EasyRoads3D that is sold on Asset Store. it should be a mono built dll that hides source code of this asset.

it’s path is; \Assets\EasyRoads3D\lib\EasyRoads3D.dll

That sounds like a bug. Can you report it?

i did. 562600

@Tautvydas what is the criteria to be compatible with phone 8 and windows app build?

i tried this;

i added an character with animation. i build this project for both window store and phone 8. i tested both, they work fine on devices.

i added playmaker to the project. it has also dll files. i did not used any object from this package… it worked on both platforms.

i deleted playmaker and added easyroads3d pro to my project. i did not used any object from this package. it generates error that i post.

The requirement is that all DLLs in the project are compatible with Windows Phone API. Thanks for reporting a bug, we’ll look into it.

what are the compatibility rules? :slight_smile: no hashmap?

You can find a list of APIs supported by Windows Phone 8 here:

package owner said he build this dll with visual studio. can it be the reason of this error? he will also build this dll with monodevelop and i will test it.

Visual Studio should work fine.

Hey guys, I’m getting a similar error when I try to build for Windows Store. Any ideas as to what might be causing it? Thanks!

Error building Player: Exception: Failed to run assembly preprocessor with cmdline “Temp/StagingArea\Data/Managed\Assembly-CSharp.dll” -injectCtor -assemblyPath “Temp/StagingArea\Managed” -pdb.[Temp/StagingArea\Data/Managed\Assembly-CSharp.dll]
Symbols will be read from Temp/StagingArea\Data/Managed\Assembly-CSharp.pdb
Injecting ctor
Injecting fast invokes
Error while in assembly preprocessor Temp/StagingArea\Data/Managed\Assembly-CSharp.dll
Object reference not set to an instance of an object.
at AssemblyPreprocessor.FastInvokeInjector.InjectUnityFastInvoke(String targetName, MethodDefinition method, TypeDefinition typeDefinition)
at AssemblyPreprocessor.FastInvokeInjector.InjectFastInvokeFunctions(TypeDefinition typeDefinition)
at AssemblyPreprocessor.FastInvokeInjector.InjectFastDelegateStubsForTypesIn(ModuleDefinition moduleDefinition)
at AssemblyPreprocessor.Program.Main(String[ ] args)

Any update on this? I’m getting the same error building for Windows Store.

We’ll need a bug a report.

Thank you

I could be wrong but I belief this is resolved in the 4.3 beta. At least, the problems Atmuc described do not occur in the 4.3 beta

it is ok with new beta version of 4.3. if i do not confuse it worked on 4.2 with new easyroads package.

I just started getting this error in 4.3.3 after I successfully built about 20 times yesterday. No differences between yesterday and today except I made a few changes to my .NET 4.5.1 DLL located in Plugins/Metro/ (all changes were private, none of the public functions changed). There are no 3rd party DLLs, only my mock .NET 3.5 DLL in Plugins/ and my true DLL in Plugins/Metro, plus one more DLL in Plugins/ which is just a class that’s shared between Unity’s scripts and the .NET 4.5.1 DLL. I’m going to try wiping the Windows 8 build folder and start again.

Edit: Wiping the Win 8 build folder didn’t help. Neither did rebuilding both the mock and the Metro DLL… I guess maybe I’ll try rebooting next. :stuck_out_tongue:

The full error:

Error building Player: Exception: Failed to run assembly preprocessor with cmdline "Temp/StagingArea\Data/Managed/Plugins/Metro\Win8StoreLib.dll" -injectCtor -assemblyPath "Temp/StagingArea\Managed" -pdb -out Temp/StagingArea\TempAssemblyPreprocessor\Win8StoreLib.dll.[Temp/StagingArea\Data/Managed/Plugins/Metro\Win8StoreLib.dll]
No symbols for Temp/StagingArea\Data/Managed/Plugins/Metro\Win8StoreLib.dll
Injecting ctor
Injecting fast invokes
Will write pdb
Error while in assembly preprocessor Temp/StagingArea\Data/Managed/Plugins/Metro\Win8StoreLib.dll
Failed to resolve assembly: 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null'
   at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
   at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
   at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
   at Mono.Cecil.TypeReference.Resolve()
   at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
   at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
   at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
   at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
   at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)
   at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
   at Mono.Cecil.MetadataBuilder.AddTypeDefs()
   at Mono.Cecil.MetadataBuilder.BuildTypes()
   at Mono.Cecil.MetadataBuilder.BuildModule()
   at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, MetadataReader _)
   at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
   at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
   at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
   at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
   at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
   at AssemblyPreprocessor.Program.Main(String[] args)

I discovered the source of my problem, though I can’t understand why it didn’t work. This code in my Plugins/Metro/Win8StoreLib.dll killed it:

public static class SaveFile {
    private const UnicodeEncoding stringEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
    private const ByteOrder byteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;
    // ... the rest of the class
}

Changing it to this no longer causes Unity to throw the error:

public static class SaveFile {
    private static readonly UnicodeEncoding stringEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
    private static readonly ByteOrder byteOrder = Windows.Storage.Streams.ByteOrder.LittleEndian;
    // ... the rest of the class
}

So it seems even though those consts were private, it couldn’t handle it. Odd.

This however does not kill it:

public static class SaveFile {
    private const byte arraySizeLength = 4;
    // ... the rest of the class
}

Hi,

that definitely looks like a bug. Could you fill a report with a simple reproduction project attached?

Okay, I submitted the bug report with repro (case 590116). Thanks!