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 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 this 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, everything 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 this library, but I don't even know where to start to fix this 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, while 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<this.Count; i++)
 {
     var item = this[i];
     if (item.Type == type) return item;
 }

But I think 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

Hm, I've been considering JSON because it's more readable, anyway. Okay, thanks for the answer! Can you quickly let me know how you found that information? I didn't know where to look.

avatar image ArkaneX · Sep 06, 2013 at 08:53 PM 0
Share

Sure :)

I added a class derived from $$anonymous$$eyedCollection to my test project, used Items property inside and then compiled for standalone - everything was fine in Visual Studio and in Unity. Then I changed target platform to web and compilation failed in Unity, though in Visual Studio it was ok.

After this, I changed target framework in Visual Studio project to Unity 3.5 Web Base Class Libraries, and compilation failed. Checking through Collection class metadata I saw no property named Items. This indicates, that mscorlib version for web is different.

And then I checked $$anonymous$$ono Compatibility page, just to confirm that the property is missing indeed.

avatar image Excrubulent · Sep 07, 2013 at 09:47 PM 0
Share

Okay, thanks for that. I guess I'll try the compact version of the library, and if that breaks I'll look into other options.

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

Error running WebGL on any browser 0 Answers

How to resolve UnauthorizedAccessException 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