Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by kiranmaya · Sep 25, 2013 at 03:33 PM · error-building-player

Error while creating WP8 build

Hi,

I getting below error when im trying to make a build for WP8 platform.

Error building Player: Exception: Failed to run assembly preprocessor with command line "Temp/StagingArea/Data/Managed\Assembly-CSharp.dll" -injectCtor -assemblyPath "Temp/StagingArea" -pdb.[Temp/StagingArea/Data/Managed\Assembly-CSharp.dll] Symbols will be read from Temp/StagingArea/Data/Managed\Assembly-CSharp.dll.mdb Injecting ctor Injecting fast invokes Error while in assembly preprocessor Temp/StagingArea/Data/Managed\Assembly-CSharp.dll

/////////////

For all other platforms its working fine. So can you guys let me know what seems to be going wrong.

Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Thomas GF · Oct 17, 2013 at 09:39 AM

Hi,

I've been having a similar problem and was able to debug into it using ProcMon.exe (a free Windows tool) and .NET Reflector Pro (not so free but ABSOLUTELY worth its money).

With ProcMon I managed to find the actual command line tool with the Parameters it is called with. On my system, the call was

"C:\\Program Files (x86)\\Unity4\\Editor\\Data\\PlaybackEngines\\wp8support\\Tools\\AssemblyPreprocessor.exe" "C:\\projectname\\Temp/StagingArea/Data/Managed\Assembly-CSharp.dll" -injectCtor -assemblyPath "C:\\projectname\\Temp/StagingArea" -pdb

With .NET Reflector I was able to decompile the tool and debug into it quite easily (as I said, .NET Reflector rocks). In my case, the problem turned out to be caused by an abstract Start() method in a MonoBehaviour. AssemblyPreprocessor.exe can't handle that and crashes.

Maybe this helps you resolve your problem as well (it should!).

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image felipemgaia · Jul 07, 2014 at 10:12 PM 0
Share

Hey $$anonymous$$, I'm trying to port an "old" game of $$anonymous$$e to Windows Phone 8 and I'm having the exact same error the OP was having. As my project is quite old and big, finding out where all the dll errors I'm having are by trial and error is almost an impossible task. I got quite interested by your solution as it is the first one I've found that seems to show exactly where the errors are. I've downloaded the programs you mentioned, but I'm afraid I'm not sure what I'm supposed to look for to get to the source of the problem. Would you $$anonymous$$d explaining in more detail the process you went through in order to find out about your issue? (in that case, the abstract Start())

avatar image
1

Answer by npruehs · Jul 10, 2014 at 09:48 AM

Hey Seraph, these methods are not available in the Editor. Be sure to wrap the respective calls with proper defines. This code snipped from our code base should give you a start. You'll still need to import System.Reflection, as you've figured out already.

 #if !UNITY_EDITOR && UNITY_WINRT
         public static bool IsValueType(Type type)
         {
             return type.GetTypeInfo().IsValueType;
         }
 
         private static IEnumerable<Type> GetBaseTypes(Type type)
         {
             yield return type;
 
             var baseType = type.GetTypeInfo().BaseType;
 
             if (baseType != null)
             {
                 foreach (var t in GetBaseTypes(baseType))
                 {
                     yield return t;
                 }
             }
         }
 
         public static PropertyInfo GetProperty(Type type, string name)
         {
             return
                 GetBaseTypes(type)
                     .Select(baseType => baseType.GetTypeInfo().GetDeclaredProperty(name))
                     .FirstOrDefault(property => property != null);
         }
 
         public static MethodInfo GetMethod(Type type, string name)
         {
             return
                 GetBaseTypes(type)
                     .Select(baseType => baseType.GetTypeInfo().GetDeclaredMethod(name))
                     .FirstOrDefault(method => method != null);
         }
 
         public static FieldInfo GetField(Type type, string name)
         {
             return
                 GetBaseTypes(type)
                     .Select(baseType => baseType.GetTypeInfo().GetDeclaredField(name))
                     .FirstOrDefault(field => field != null);
         }
 
         public static bool IsEnum(Type type)
         {
             return type.GetTypeInfo().IsEnum;
         }
 
         public static Delegate CreateDelegate(Type type, object target, MethodInfo method)
         {
             return method.CreateDelegate(type, target);
         }
 
         public static bool IsAssignableFrom(Type first, Type second)
         {
             return first.GetTypeInfo().IsAssignableFrom(second.GetTypeInfo());
         }
 #else
         public static bool IsValueType(Type type)
         {
             return type.IsValueType;
         }
 
         public static PropertyInfo GetProperty(Type type, string name)
         {
             return type.GetProperty(name);
         }
 
         public static MethodInfo GetMethod(Type type, string name)
         {
             return type.GetMethod(name);
         }
 
         public static bool IsEnum(Type type)
         {
             return type.IsEnum;
         }
 
         public static FieldInfo GetField(Type type, string name)
         {
             return type.GetField(name);
         }
 
         public static Delegate CreateDelegate(Type type, object target, MethodInfo method)
         {
             return Delegate.CreateDelegate(type, target, method);
         }
 
         public static bool IsAssignableFrom(Type first, Type second)
         {
             return first.IsAssignableFrom(second);
         }
 #endif
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rchapman · Aug 22, 2014 at 10:18 PM 0
Share

Hi npruehs - I'm curious how you got this to build in Unity. I'm still getting a build error when it's creating the actual VS project despite "using System.Reflection" and adding the conditionals. $$anonymous$$y guess is that Unity isn't referencing the right assembly behind the scenes, but that's just a guess.

avatar image
0

Answer by Seraph Auto · Sep 26, 2013 at 09:54 AM

I also get the same error. In addition, another error is also comes with it.

Type System.Type' does not contain a definition for GetTypeInfo' and no extension method GetTypeInfo' of type System.Type' could be found (are you missing a using directive or an assembly reference?)

but I already added using System.Reflection and I checked this method is supported by Windows Store App and WP8.

Did any other guy have similar problem?

Thanks

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by itachi4365 · Apr 10, 2014 at 07:07 PM

Just make sure that no project is open in Visual Studio while you are building it. Closing visual studio worked for me.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by apparition · Aug 25, 2015 at 02:48 PM

As npruehs says, wrap the code with #IF !UNITY_EDITOR && UNITY_WINRT, and also make sure you have using System.Reflection;

GetTypeInfo is an extension method in the System.Reflection namespace.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Error building Player because scripts had compiler errors 2 Answers

plz help i have a problem in making apk file this error comes,plz help me an error comes when i try to build an apk file 0 Answers

Error when i'm building with unity3d 3.5 not beta 1 Answer

Target SDK doesn't support runtime permissions but the old target SDK 23 does 1 Answer

Build for Windows Phone 8 problem 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges