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 Zerlingmusic · Jul 20, 2014 at 01:27 PM · build-errortypeloadexception

Editor throws TypeLoadException during build

Hi. I have a project that runs without errors in the editor. But when i try to make a build, it stops compiling at ~15-20% and gives me those errors (horizontal lines are not part of error text, i just thought it would be nice to separate everything visualy):

 NullReferenceException: Object reference not set to an instance of an object
 UnityEditor.AssemblyTypeInfoGenerator.GetFields (Mono.Cecil.TypeDefinition type, Boolean isGenericInstance, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/BuildPipeline/AssemblyTypeInfoGenerator.cs:229)
 UnityEditor.AssemblyTypeInfoGenerator.AddType (Mono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/BuildPipeline/AssemblyTypeInfoGenerator.cs:150)
 UnityEditor.AssemblyTypeInfoGenerator.AddBaseType (Mono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/BuildPipeline/AssemblyTypeInfoGenerator.cs:209)
 UnityEditor.AssemblyTypeInfoGenerator.AddType (Mono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceTypeMap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/BuildPipeline/AssemblyTypeInfoGenerator.cs:161)
 UnityEditor.AssemblyTypeInfoGenerator.GatherClassInfo () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/BuildPipeline/AssemblyTypeInfoGenerator.cs:302)
 UnityEditor.AssemblyHelper.ExtractAssemblyTypeInfo (System.String assemblyPathName) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/AssemblyHelper.cs:262)
 

 Internal compiler error. See the console log for more information. output was:
 Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
 
   at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
 
   at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
 
   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0 

Error building Player because scripts had compiler errors

Comment
Add comment · Show 3
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 Zerlingmusic · Jul 26, 2014 at 08:08 AM 0
Share

Come on, guys! I get, that not everyone is willing to sacrifice their own time to fix others problems, but a least give me a quick tip: where and what should I google to find the solution? $$anonymous$$ay be it looks like missing dll? Or may be some script that i don't use in my scene, but have in project folder, can mess with compiler logic? What would you check if you had such problem?

avatar image gjf · Jul 26, 2014 at 02:39 PM 0
Share

which target?

do you get the same errors if you try building for a different target?

avatar image Zerlingmusic · Jul 27, 2014 at 08:30 AM 0
Share

Sims like it's same for evrything exept Web:

 NullReferenceException: Object reference not set to an instance of an object
 UnityEditor.AssemblyTypeInfoGenerator.GetFields ($$anonymous$$ono.Cecil.TypeDefinition type, Boolean isGenericInstance, System.Collections.Generic.Dictionary`2 genericInstanceType$$anonymous$$ap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/$$anonymous$$ono/BuildPipeline/AssemblyTypeInfoGenerator.cs:229)
 UnityEditor.AssemblyTypeInfoGenerator.AddType ($$anonymous$$ono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceType$$anonymous$$ap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/$$anonymous$$ono/BuildPipeline/AssemblyTypeInfoGenerator.cs:150)
 UnityEditor.AssemblyTypeInfoGenerator.AddBaseType ($$anonymous$$ono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceType$$anonymous$$ap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/$$anonymous$$ono/BuildPipeline/AssemblyTypeInfoGenerator.cs:209)
 UnityEditor.AssemblyTypeInfoGenerator.AddType ($$anonymous$$ono.Cecil.TypeReference typeRef, System.Collections.Generic.Dictionary`2 genericInstanceType$$anonymous$$ap) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/$$anonymous$$ono/BuildPipeline/AssemblyTypeInfoGenerator.cs:161)
 UnityEditor.AssemblyTypeInfoGenerator.GatherClassInfo () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/$$anonymous$$ono/BuildPipeline/AssemblyTypeInfoGenerator.cs:302)
 UnityEditor.AssemblyHelper.ExtractAssemblyTypeInfo (System.String assemblyPathName) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/$$anonymous$$ono/AssemblyHelper.cs:262)
 UnityEditor.HostView:OnGUI()


 Internal compiler error. See the console log for more information. output was:
 Unhandled Exception: System.TypeLoadException: Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'ServiceStack.Text'.
 
   at $$anonymous$$ono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
 
   at $$anonymous$$ono.CSharp.Driver.$$anonymous$$ain (System.String[] args) [0x00000] in <filename unknown>:0 

Error building Player because scripts had compiler errors

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by rutter · Jul 29, 2014 at 05:41 PM

All hubbub aside, the compiler is throwing a TypeLoadException because it's failing to access some class during the build process. This is usually caused by a conflicting name.

Do any of your classes have the same name as some class in Unity?

Are you using any plugins that might have that problem? Especially if you have dll files in your project. Most reports I saw about this were trying to mix Playmaker and some Kinect plugin, but that doesn't mean it couldn't happen elsewhere.

Comment
Add comment · Show 2 · 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 Zerlingmusic · Jul 30, 2014 at 04:58 AM 0
Share

Yes!!! There was a ServiseStack.Text.dll in my Assets folder. After deleting it, errors were gone! I guess, i didn't notice it when copying files to new project - that's why there everything worked.

Thanks a lot!

avatar image Influnza · Aug 28, 2017 at 12:54 AM 0
Share

I was hitting this error in VS after upgrading my UWP game from 5.6.1 to 2017.2.0b8. In my case I had to reimport Text$$anonymous$$esh Pro package and delete the UWP folder and build again. Thank you for the clue, the error message is super cryptic!

avatar image
0

Answer by Zerlingmusic · Jul 29, 2014 at 05:34 PM

Okay it's kinda solved, but is even wierder now. I've mede a new project and copied all the files from this one to mess with them an see what causes the mistake. I tryied to make a build as it is just to be sure to get same mistakes - and everything worked out! The build was complete with no errors! I launched it and it worked as intended. Tried to do same with old project - and got those errors. Tried do do that in new project - everything was working.

I have no problems with finishing the projest in the new folder, but i'm still curious: what could that be?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

How can I stop the variable values reverting to its default values after being built? 1 Answer

TypeLoadException: System.Security.Authentication.ExtendedProtection.ChannelBinding 1 Answer

Building for iPad 1 Answer

Mono Error when compiling scripts 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