Question

I have VS2012 and VS2010 installed. I am using first one to create PCL core of my Mobile app in MVVMCross vNext and using VS2010 to open UI.WP7 on WP7 emulator (due to problems with connecting to WCF by VS2012 WP emulator - it can not connect to my network brigde). Everything is going alright until i use this code:

protected void NavigateToClient(ClientDataRepository client) { RequestNavigate(new { key = client.IDKlient + "clients"}); }

On VS2012 is working well but in VS2010 i have exception (i reference to core and mvvmcross pcl by .dll)

"Problem accessing object - most likely this is caused by an anonymous object being generated as Internal - please see Anonymous types and Get accessors on WP7.1?");

I made assembly InternalToVisible with PublicKey, in my core and even in Cirrious.MvvmCross solution but it doesn't help. Is there any hope to get it work? By the way - is every solution has the same PublicTokenKey?

Was it helpful?

Solution

There isn't any signing involved - so you shouldn't need to use a Public Key Token.

One line should be enough:

     [assembly: InternalsVisibleTo("Cirrious.MvvmCross")]

That needs to be in the assembly where the anonymous object is created - as that's where the compiler will generate the internal anonymous class.

Like in https://github.com/slodge/MvvmCross/blob/vnext/Sample%20-%20CustomerManagement/CustomerManagement/CustomerManagement/Properties/AssemblyInfo.cs#L30

This works for me both in VS2010 and VS2012 (with WP7.1 and WP8 SDKs)


If this just doesn't work for you, then you can always use a Dictionary<string,string> instead for navigation - or you could use a non-anonymous class.


For working around 'it can not connect to my network bridge' try using Ethernet - that works for me on my laptop (and one day I hope to get WiFi working too with the Win8 emulator)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top