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
0
Question by thraxST · Oct 28, 2013 at 02:48 PM · webplayerbuild-error

Fixing build errors in Web Player caused by external libraries.

I am currently using Moq and a customized version of SharpUnit to perform unit testing in my game. Everything works great, the only problem is that when I switch to a Web Player build I get the following error.

 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

If I remove Moq.dll and comment out all the references to it, the errors goes away. Is there anyway to get the Web Player to ignore the library and it's references so I don't have to delete the library and all the unit tests every time I want to build a Web Player version?

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

2 Replies

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

Answer by thraxST · Oct 28, 2013 at 03:37 PM

So the solution I found for now is to just put all the testing code and libraries in the Editor folder. Not sure if it is the right answer, but since it is not actually part of the game and only intended to be used from the editor, it doesn't need to be in with other game libraries.

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 Dave-Carlile · Oct 28, 2013 at 03:25 PM

You should be able to do something using Conditional Compilation. Just surround the Moq code with conditional compilation so it doesn't compile when building the web player version. I'm not sure what that will do with the moq.dll, but if all references to it are compiled out it shouldn't make any attempt to load it.

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 thraxST · Oct 28, 2013 at 03:29 PM 0
Share

Even with all the references to $$anonymous$$oq commented out of the code, Unity still tries to load moq.dll.

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

16 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

Related Questions

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

Weird game-output! 1 Answer

problem when building with web player 1 Answer

Chrome displaying new tab page instead of game 0 Answers

Writing file error - Can't Build to WebPlayer 0 Answers


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