Using SharpKit with Portable Class Libraries

61 views
Skip to first unread message

Jan Mikeska

unread,
Dec 13, 2012, 9:58:32 AM12/13/12
to shar...@googlegroups.com
Hello,

We are evaluating SharpKit for use in our project. It's a large code base with extensive use of Portable Class Libraries currently shared between server and Silverlight applications. The idea is to write a new JavaScript client using the existing PCLs which we are hopping to 'compile' to JavaScript. 

The issue we have run into is that class library project needs to reference SharpKit.JavaScript.dll which is compiled as the full .NET assembly and therefore cannot be used with our PLCs. 

Is there a version of SharpKit for Portable Class Libraries? Or any other way how to overcome this? - Thanks in advance for any suggestions

Regards

Dan-el Khen

unread,
Dec 13, 2012, 10:19:00 AM12/13/12
to shar...@googlegroups.com
Hi Jan,

This seems like a .NET 4.5 feature, we haven't created a build output for 4.5 yet, although I don't see any reason it shouldn't work. Would you like to download the SharpKit.JavaScript sources, and try to compile them in this mode? You can get them using SVN from here:

Please post back here if you need any help, in any case I'd be very happy if you share your results with us.

Cheers
Dan-el

Jan Mikeska

unread,
Dec 13, 2012, 1:49:53 PM12/13/12
to shar...@googlegroups.com
Hi Dan-el,

Thanks for the info - I didn't know the source code was available. I tried converting SharpKit.JavaScript to a portable class library but it won't compile without modifications as PCLs support just a subset of the full blown .NET.

So far, I think I will only need to modify the SharpKit.JavaScript in order to make this work. It should be possible to fix it with a few minor changes. If I succeed I will share the solution here.

Regards,
Jan

Dan-el Khen

unread,
Dec 16, 2012, 3:40:01 AM12/16/12
to shar...@googlegroups.com
Hi Jan,

There isn't any usage of real .NET in the JavaScript assembly, it's just an empty shell, so I hope it would be easy, please let me know if you need any help.

Thanks!
Cheers
Dan-el

Jan Mikeska

unread,
Apr 8, 2013, 12:48:59 PM4/8/13
to shar...@googlegroups.com
Hi Dan-el,

I was able to convert the JavaScript project to a portable class library, mostly by changing csproj and AssemblyInfo. All working great! However I had to comment out 3 lines in public partial class 'JsError : Exception' in order to compile it. Working but I'm afraid of running into issues further down the road... Would you be willing to take a look into it and possibly make it a part of the official release?

I've included the modified files.

Kind Regards,
Jan
SharpKit.JavaScript.zip

Dan-el Khen

unread,
Apr 8, 2013, 3:19:26 PM4/8/13
to shar...@googlegroups.com
Hi Jan,

Thanks for the detailed explanation. You shouldn't worry about these lines, this entire file is designed to help with some mappings between .NET and JavaScript, there isn't really much you can do that would hurt anything in the future. Your sample looks good to match the portable class library. Since this setup requires changes in the csproj file (in the ProjectGuids element), what we can do is to create another project configuration, and conditionally add/remove the problematic lines. This would give you a specialized assembly for this setup, and still be maintained as part of the standard SharpKit version.

Could this work for you?

Cheers
Dan-el



--
You received this message because you are subscribed to the Google Groups "SharpKit Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharpkit+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages