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 Theodus · Mar 27, 2014 at 05:36 PM · compiler errorwindows 8windows8windows8 store

Windows Store Compile Error: Dictionary instead of Hashtable?

Foreword: I have already searched the Unity forums as well as here, but if I missed something please let me know.

I'm porting our existing Unity game (currently on iOS, Android, and Facebook) to the Windows Store platform. I've gone through the links listed here and have made tiny baby steps towards a build-able game, and I expect more issues later down the road, but I've already hit my first roadblock.

Now, when I switch my platform to Windows Store, I get this error:

 error CS1502: The best overloaded method match for `UnityEngine.WWW.WWW(string, byte[], System.Collections.Generic.Dictionary<string,string>)' has some invalid arguments
 error CS1503: Argument `#3' cannot convert `System.Collections.Hashtable' expression to type `System.Collections.Generic.Dictionary<string,string>'

The documentation on WWW says that third parameter is a System.Collections.Hashtable. For some reason when targeting Windows Store, Unity thinks that WWW takes a Dictionary<string, string> instead. I am aware that Windows Store apps use a different version of .NET that doesn't define Hashtables, and I'm using the new definitions written by Jodon Karlik's in his example project here. However all of that is wrapped in a #if UNITY_WINRT && !UNITY_EDITOR, so it should only take effect while building or on device.

I have a feeling it's something to do with what version of .NET being used. My Compilation Override is set to None, so by my understanding the editor should still be using Mono.

From my search, it seems that my issue is unique. Any help at all, if it's something obvious I missed or it's something ridiculously obscure and undocumented, would be helpful!

Comment
Add comment · Show 2
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 Professor Snake · Mar 27, 2014 at 05:38 PM 0
Share

If you suspect it's an issue with .NET, try changing the API compatibility version to .NET 2.0 ins$$anonymous$$d of 2.0 subset, in Project Settings>Player>Other Settings

avatar image perchik · Mar 27, 2014 at 05:43 PM 0
Share

You could use Linq to convert the hashtable to a database in a platform specific conditional as a way to solve the problem, but I think you're asking about why the problem occurs, rather than a solution.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Theodus · Mar 27, 2014 at 08:35 PM

I found a workaround that serves my purposes, at least for the time being - I am still only at the beginning of the port process, so we'll see.

In the spirit of perchik's advice, I simply wrote a function to convert a Hashtable to a Dictionary so WWW would shut up. Fortunately we weren't using it in too many places, so it wasn't as big a deal as I was dreading.

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

22 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Windows 8 Store App Build doesn't launch 0 Answers

Windows Store Apps WACK failed : Performance suspend 0 Answers

How do I fix compliance error? 1 Answer

Compilation failed because the compiler couldn't be executed! 2 Answers

Unity Standard Assets' CrossPlatformInputInitialize has errors 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