OK - please do ping me again when you do have the error messages and code in a more easy to get to place.
Where I've hit problems with non-portable classes in Mvx, then I've put an IoC based plugin mechanism in place to handle those . For example, in one case I wanted Thread.Sleep - so I added a simple IoC plugin to provide it - https://github.com/slodge/MvvmCross/tree/vnext/Cirrious/Plugins/ThreadUtils. However, I admit that I've not yet tried to use this for a large legacy codebase - and I still don't yet have this running on iOS. Given that your "separate libraries" code was working on MonoDroid with just references to System, System.Core and mscorlib I do hope you'll be able to achieve what you want Good luck! Stuart On 14 May 2012 12:30, SRI <[email protected]> wrote: > Hi Stuart, > > I have tried with various profiles (Profile 2, Profile 3 and > Profile 14) but I am using Profile 3 (.NET 4 and Silverlight4) because > then only I will get ThreadStaticAttribute. > > Portable Library does not implement ThreadStatic if using > Profile2. I have also removed NetworkStream.cs from my project which > was hitting the socket error. It seems I have not used it. Copying so > much from Mono and make it work is hell, but now hitting other > problems like Path.Combine, File not found even though System.IO is > referenced. > > I believe what I am trying to do is non-standard and I am > hitting referencing errors which are weird. > > I will get back to this after I have cleaned up the System.Web > MonoDroid/MonoTouch Project and publish it in GitHub for others more > intelligent than me to look and port to a Portable project. > > Thanks for all the help. > > Best Regards, > Sridharan Srinivasan > Alias Sri. > > On Mon, May 14, 2012 at 7:07 PM, Stuart Lodge <[email protected]> wrote: > > Can you post the exact error messages from the compiler? And the exact > > namespace/class name(s) that are failing? > > > > Also a snippet of code that is failing to compile would be useful. > > > > And it would be useful to know what it says in your portable project file > > for profile number - the line that > > says <TargetFrameworkProfile>Profile???</TargetFrameworkProfile> > > > > Stuart > > > > > > On 14 May 2012 11:52, SRI <[email protected]> wrote: > >> > >> Hi Stuart, > >> > >> Thanks for all the advice, but my problem is far more complex > >> and may be it will not work. > >> > >> First I have ported System.Web to Android/IOS/WP7 which means > >> copying/modifying not just classes for System.Web from Mono but also > >> from corlib, system, system.core, system.drawing, > >> system.web.abstractions, system.web.routing to make it work (Since the > >> Monodroid/Monotouch has many missing classes which are required to > >> port System.Web). I was even able to compile this in WP7.5, but > >> because of broken socket implementation it is not useful. > >> > >> The reason why I had to do the above was I want to build a cross > >> platform micro web server running in Mono-Droid/Mono Touch for one of > >> my JQuery Mobile projects. > >> > >> The current problem I have are I am not able to compile my > >> android project (which has dependency on Mono for Androids/MonoTouch > >> (mscorlib, System & System.Core dlls only) as a Portable Project. I > >> have choosen the Target Frameworks as .NET 4.0 and Silverlight 5.0, > >> but still hit error that socket is not available. I have tried all > >> sort of combination of Target Framework, but still have the same 7 > >> errors (socket type or namespace could not be found) > >> > >> If I understand correctly what you have accomplished is making > >> it runnable in MonoDroid by using TypeForwarderTo, what problem I am > >> facing is that I cannot even compile the portable project because of > >> something. > >> > >> When I created a MonoDroid Library Project using your > >> Forwarder.cs, I was not able to reference that project in my Portable > >> Project. When I create a Portable Project using your Forwarder.cs I > >> was not able to compile. > >> > >> Any advice would be greatly appreciated. > >> > >> Best Regards, > >> Sridharan Srinivasan > >> Alias Sri. > >> > >> > >> On Mon, May 14, 2012 at 6:14 PM, Stuart Lodge <[email protected]> wrote: > >> > And a final final answer.... > >> > > >> >> what about conflicts with the System.Net provided in the Microsoft > PCL. > >> > > >> > When you link your monodroid app it will link against the assemblies > in > >> > the > >> > folders like "C:\Program Files (x86)\Reference > >> > Assemblies\Microsoft\Framework\MonoAndroid\v1.0" - so there won't be > any > >> > conflict with any Microsoft assembly. > >> > > >> > The posts by Jeremy Likeness help to explain all this - but it took > me a > >> > few > >> > readings to really understand them - > >> > > >> > > http://csharperimage.jeremylikness.com/2012/03/understanding-portable-library-by.html > >> > > >> > > >> > On 14 May 2012 11:00, Stuart Lodge <[email protected]> wrote: > >> >> > >> >> P.S. For "what profile did I choose"... > >> >> > >> >> - for "back end code" you can use Profile 2 - see the post at > >> >> > >> >> > http://jpobst.blogspot.co.uk/2012/04/mono-for-android-portable-libraries-in.html > >> >> > >> >> - if you start using newer features like system.xml.linq or some of > the > >> >> mvvm objects (ICommand and ObservableCollection), then you need to > >> >> install > >> >> VS11 to get "profile 104" - see some notes > >> >> > >> >> on > http://slodge.blogspot.co.uk/2012/04/using-portable-library-tools-for.html > >> >> > >> >> > >> >> If you do get somewhere with PCLs please tweet about it - I'd love to > >> >> see > >> >> the BCL team inside Microsoft need encouraged to support this even > more > >> >> :) > >> >> > >> >> > >> >> On 14 May 2012 10:52, Stuart Lodge <[email protected]> wrote: > >> >>> > >> >>> Hi Sri > >> >>> > >> >>> I think the problem you are seeing is that Portable Class Libaries > are > >> >>> built against a set of DLLs which includes a strong reference to the > >> >>> System.Net types being in System.Net.dll > >> >>> > >> >>> To get around this, I've written a type forwarding assembly for > >> >>> System.Net for MonoDroid - > >> >>> > >> >>> see > https://github.com/slodge/MvvmCross/tree/vnext/Cirrious/System.Net - > >> >>> especially the forwarding.cs class > >> >>> > >> >>> - > https://github.com/slodge/MvvmCross/blob/vnext/Cirrious/System.Net/Forwarding.cs > >> >>> > >> >>> Note that this type forwarding assembly is itself a MonoDroid class > >> >>> library and it forwards to the real implemented System.Net types > which > >> >>> are > >> >>> stored within the MonoDroid System.dll - I think they are there > >> >>> because of > >> >>> historical moonlight reasons - i.e. it's all Microsoft's fault ;) > >> >>> > >> >>> If you include that type forwarding dll in your android app, then it > >> >>> should get past your current build error - and hopefully it'll run > :) > >> >>> > >> >>> One fortunate thing here is that the MonoDroid runtime doesn't seem > to > >> >>> enforce strong assembly signing rules at runtime - so it's happy to > >> >>> accept > >> >>> our System.Net.dll in place of the strongly signed Microsoft one. > >> >>> > >> >>> However.... if you are unlucky.... then I have also seen some > >> >>> compilation > >> >>> problems in some projects where the compiler has tried to strongly > >> >>> enforce > >> >>> parameter types - e.g. I did find some problems where a System.Uri > >> >>> wouldn't > >> >>> transfer nicely from MonoDroid to portable code - but I also found > >> >>> other > >> >>> places where the compiler didn't complain! If you hit these sorts of > >> >>> errors > >> >>> let me know - I've got half a tool written which decompiles the > >> >>> portable > >> >>> libraries and replaces the keys of the strong assembly names with > the > >> >>> mono > >> >>> equivalents - I'm hoping it will be easy to run that as a pre-build > >> >>> step if > >> >>> I ever absolutely need it. > >> >>> > >> >>> Hope that helps > >> >>> > >> >>> Stuart > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> On 14 May 2012 10:36, SRI <[email protected]> wrote: > >> >>>> > >> >>>> Hi Stuart, > >> >>>> > >> >>>> I have a Library (Based on System.Web which includes > >> >>>> Jayrock/SignalR/PetaPoco/Protobuf) which has been ported to run in > >> >>>> Android/IOS/WP7*/Linux/MacOSx and the Only dependency are mscorlib, > >> >>>> System and System.Core. It is working very well in my Cross > Platform > >> >>>> Framework and I want to convert it to a Portable Library so that > >> >>>> instead of 4 * 4 projects ( > >> >>>> (System.Web/Arshu.Core/Arshu.Data/Arshu.Grid) per Environment, I > can > >> >>>> use just 4 projects. > >> >>>> > >> >>>> I have currently tried creating a PCL using VS2010 and > >> >>>> included the Android Files, but hitting a error that Socket is not > >> >>>> found. What Profile did you choose when you did the compilation. I > am > >> >>>> not able to use Reflector to find whether Socket Class is defined. > I > >> >>>> saw your code and you are having a redirect for the Socket Class. > >> >>>> > >> >>>> Do I need to create a New Project called System.Net (In > >> >>>> MonoDroid/MonoTouch/WP7)??? where I write the Redirect code and > what > >> >>>> about conflicts with the System.Net provided in the Microsoft PCL. > >> >>>> > >> >>>> Can you give me any advice on how to go about it. > >> >>>> > >> >>>> -- > >> >>>> Sridharan Srinivasan > >> >>>> Alias Sri > >> >>>> Ph:(65)98255785/(65)63922439 > >> >>>> www.arshu.com > >> >>>> _______________________________________________ > >> >>>> Monodroid mailing list > >> >>>> [email protected] > >> >>>> > >> >>>> UNSUBSCRIBE INFORMATION: > >> >>>> http://lists.ximian.com/mailman/listinfo/monodroid > >> >>>> > >> >>> > >> >> > >> > > >> > > >> > _______________________________________________ > >> > Monodroid mailing list > >> > [email protected] > >> > > >> > UNSUBSCRIBE INFORMATION: > >> > http://lists.ximian.com/mailman/listinfo/monodroid > >> > > >> > >> > >> > >> -- > >> Sridharan Srinivasan > >> Alias Sri > >> Ph:(65)98255785/(65)63922439 > >> www.arshu.com > >> _______________________________________________ > >> Monodroid mailing list > >> [email protected] > >> > >> UNSUBSCRIBE INFORMATION: > >> http://lists.ximian.com/mailman/listinfo/monodroid > >> > > > > > > _______________________________________________ > > Monodroid mailing list > > [email protected] > > > > UNSUBSCRIBE INFORMATION: > > http://lists.ximian.com/mailman/listinfo/monodroid > > > > > > -- > Sridharan Srinivasan > Alias Sri > Ph:(65)98255785/(65)63922439 > www.arshu.com > _______________________________________________ > Monodroid mailing list > [email protected] > > UNSUBSCRIBE INFORMATION: > http://lists.ximian.com/mailman/listinfo/monodroid > >
_______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
