Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Friend access was granted to System.Net #60

Closed
schappel opened this issue Nov 26, 2012 · 7 comments
Closed

Friend access was granted to System.Net #60

schappel opened this issue Nov 26, 2012 · 7 comments
Labels
t/bug Bug type

Comments

@schappel
Copy link

I am getting the following error when compiling for MonoDroid using MonoTouch on the Mac:

Friend access was granted to System.Net, PublicKeyToken=7cec85d7bea7798e', but the output assembly is namedSystem.Net, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Try adding a reference to `System.Net, PublicKeyToken=7cec85d7bea7798e' or change the output assembly name to match it

Could this be solved with the steps from your post: http://slodge.blogspot.co.uk/2012/11/thanksgiving-post-thanks-for-more.html ?

@slodge
Copy link
Contributor

slodge commented Nov 26, 2012

There is no way to solve this properly yet....

It's a problem only when compiling in MonoDevelop (not VS)

The MonoTouch solution works around this by building to a System.Net.Touch.dll name and then doing a rename to System.Net.dll

I have opened this up on https://bugzilla.xamarin.com/show_bug.cgi?id=8035 last month (and on StackOverlfow in September - http://stackoverflow.com/questions/12433701/building-a-system-net-surrogate-dll-under-monotouch-avoiding-a-friend-access)

I've got agreement from engineers at both Xamarin and Microsoft than one or both of them should ship these shim dll's really... but no real action from either yet.

As a workaround, I will put the same workaround as Touch has for this - will do at some point this week....

For MonoDroid, a similar fix will be needed for the System.Xml.Serialization shim too.

Sorry about leaving this in there thsi long (Redth told me about it at the end of last week)

Stuart

@slodge
Copy link
Contributor

slodge commented Nov 26, 2012

ie if you need this to build for you now:

  1. Change the System.Net.Droid output assembly name to System.Net.Droid.dll
  2. Add a rename PostBuild task - see CustomCommands in the Touch version - https://github.com/slodge/MvvmCross/blob/vnext/PortableSupport/System.Net.Touch/System.Net.Touch.csproj
  3. Maybe, you will also need to edit a few csproj files (mainly the samples) so that they reference the bin/Droid/debug/System.Net.dll by file rather than by project

The main delay for me doing this myself is setting up my Mac for Droid development!

Hope that helps

Stuart

@slodge
Copy link
Contributor

slodge commented Nov 26, 2012

If that doesn't make sense you can ping me on http://jabbr.net/#/rooms/mvvmcross - although I have a feeling we are in different timezones :)

@schappel
Copy link
Author

Thanks, that seems to do the trick. I guess the fun part is trying to keep the projects consistent between Windows and OSx.

On a different note, I must say from what I have seen you have done a great job. I previously have used Caliburn.Micro in a number of WP7 / WPF applications, and it doesn't seem like too much of a leap to get my head around MvvmCross. BTW: If you ever decided to merge with Caliburn I think the ultimate Mvvm Framework could be created. (just saying)

@schappel
Copy link
Author

To get around the Windows (Visual Studio) / OSx (MonoDevelop) I just hacked the project file (based on a previous post of yours) to conditionally change the assembly output name:

    <AssemblyName Condition="'$(OS)' != 'Windows_NT'">System.Net.Droid</AssemblyName>
    <AssemblyName Condition="'$(OS)' == 'Windows_NT'">System.Net</AssemblyName>

@schappel schappel reopened this Nov 27, 2012
@slodge
Copy link
Contributor

slodge commented Dec 19, 2012

I do believe I fixed this and checked in the changes... but I haven't tested yet!

@slodge
Copy link
Contributor

slodge commented Dec 21, 2012

Finally tested on the Mac - it didn't build....

Problem still there with the xml serialization project

Fixed that now....

  • so closing.

Thanks again for the bug report - bug squashed :)

@slodge slodge closed this as completed Dec 21, 2012
martijn00 added a commit to martijn00/MvvmCross that referenced this issue Dec 8, 2016
martijn00 added a commit to martijn00/MvvmCross that referenced this issue Dec 8, 2016
[Feature] Use MvxForms with MasterDetailPage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Bug type
Development

No branches or pull requests

2 participants