Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 hulahulahest · Aug 20, 2015 at 12:16 PM · crashserialization.net.net-assemblies

Unity fails to load protobuf assembly for unclear reasons

I am working on a game that needs to share code with a separate .NET program. Therefore, a significant part of the game's code is in an external assembly (the "core" assembly) that is separately compiled with VS2015 and included in Unity's asset structure as well as referenced by the other program. This has worked fine up to now, without any strange problems.

Now, I want to start using protobuf-net for serialization. I'm using the "full/unity" protobuf assembly. Because this may eventually have to run on iOS, I am precompiling the protobuf type model as a separate assembly which is also referenced by the core assembly. Unit tests run through VS2015 confirm that my protobuf integration is working, that the precompiled serializer is working as intended and producing consistent results, etc.

However, when I include the core assembly with the precompiler serializer in Unity, Unity will no longer load the core assembly, which renders the entire game inoperational. Furthermore, trying to start the game in this state just plain crashes Unity.

The error Unity spits out is, as usual, not helpful:

 FileNotFoundException: Could not load file or assembly 'DomCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

It's just a dozen lines of that followed by errors from inside Assembly-CSharp, which are cascade errors resulting directly from the failure to load the assembly in the first place. There is no information regarding which dependency fails to load (although it almost certainly is the precompiled serializer), nor what the reason for the failure is.

I have confirmed that removing the precompiled serializer and using the reflecting runtime type model works as expected inside Unity, but this is not an acceptable solution because the runtime type model will not work on iOS. Additionally, remember that the precompiled serializer does work from inside VS2015, just not in Unity.

All involved assemblies are compiled against .NET 2.0. The only system assemblies referenced are mscorlib (2.0), System (2.0), and System.Core (3.5). This is the same regardless of whether I use the precompiled serializer or not.

I have gone through the various assemblies' dependencies with ILSpy to confirm that there are no strange or missing dependencies, and it confirms the above regarding the expected versions of the involved assemblies.

As the message presented by Unity is unhelpful, and nothing about the assembly itself seems wrong, and nor does it fail when run through VS, I don't know how to proceed with this issue.

I am using Unity 5.1.2f1 Personal.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by nedma007 · Dec 17, 2015 at 02:40 PM

Hi, although not 100% sure, I think this is a unity mono bug which is caused by too many ProtoMember or maybe too many class members of the ProtoContract classes in total.

To get rid of the error, please try to make the ProtoContract classes less members in total.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Can Unity work with a "Managed .NET assembly (NatNetML.dll) for use in .Net compatible clients"? 1 Answer

Error occured performing webclient request. Application runs in editor but fails in standalone player 1 Answer

Create a .net library for hololens / uwp 2 Answers

Unity 2017.3 Experimental 4.6 .NET not including System.Web.Http assembly for HttpClient use 0 Answers

Unable to pass aws credentials at runtime in iOS 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