• 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 Excrubulent · Sep 05, 2013 at 11:13 PM · errorwebplayerlibraryplatform-support

sharpSerializer Error CS0103 when webplayer selected in build settings

I'm using an external library sharpSerializer in Unity 4.2.1f4 (latest), and I'm getting t$$anonymous$$s error message:

Assets/Scripts/Libraries/SharpSerializer/Advanced/PropertyProvider.cs(302,57): error CS0103: The name `Items' does not exist in the current context

But I'm only getting that message when webplayer is selected in the build settings. When a standard desktop build is selected, everyt$$anonymous$$ng compiles and I can run in-editor and build a standalone executable. SharpSerializer works just fine.

So there's obviously some sort of problem building the webplayer with t$$anonymous$$s library, but I don't even know where to start to fix t$$anonymous$$s problem. I want to be able to build for webplayer.

The specific file that's throwing the error is here in the library's repo:

http://sharpserializer.codeplex.com/SourceControl/latest#SharpSerializer.Library/Advanced/PropertyProvider.cs

The offending line is near the end of the file. I'm only using the contents of the SharpSerializer.Library folder.

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
2
Best Answer

Answer by ArkaneX · Sep 06, 2013 at 09:09 AM

I've just checked, and it seems there's a difference in implementation of Collection class between mscorlib used for web player and the one used for standalone. In standalone implementation you can find Items property, w$$anonymous$$le web player implementation doesn't contain it. Additionally, in Unity Mono Compatibility page, you can see that there's no Items property under Collection class.

I guess you can compile sharpserializer by yourself, changing the offending part of source code to

 for(int i=0; i<t$$anonymous$$s.Count; i++)
 {
     var item = t$$anonymous$$s[i];
     if (item.Type == type) return item;
 }

But I t$$anonymous$$nk you can encounter a lot more errors during compilation.

Another option would be considering other serialization libraries. Maybe JSON-based?

Comment
Add comment · Show 3 · 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 Excrubulent · Sep 06, 2013 at 04:14 PM 0
Share
avatar image ArkaneX · Sep 06, 2013 at 08:53 PM 0
Share
avatar image Excrubulent · Sep 07, 2013 at 09:47 PM 0
Share

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Error running WebGL on any browser 0 Answers

Cannot compile .exe with specific .dll. (but with other .dlls created the same way) 0 Answers

What kind of error handling does the WWW class have? 1 Answer

What is an alternative to using System.IO Stream when building for webplayer ? 3 Answers

Why isn't the Unity Web Player working? 4 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