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

.netstandard 1.x support? #219

Closed
yetanotherchris opened this issue Jul 25, 2016 · 13 comments
Closed

.netstandard 1.x support? #219

yetanotherchris opened this issue Jul 25, 2016 · 13 comments

Comments

@yetanotherchris
Copy link

yetanotherchris commented Jul 25, 2016

Hi - thanks for making this open source, it's amazing how fast it is and cleanly written code.

Are there any plans to support .netstandard 1.x any time soon? I tried cloning and using the VS tool but there were a few problems with Emit.

I'm not sure if that was the codebase or because I don't have the whole PCL bits installed though.

@negue
Copy link
Contributor

negue commented Jul 25, 2016

Could you try the Core Project ? This doesn't use Emit.

I tried it myself many times with .netstandard & (and .NetCore) but got overwhelmed with possiblies of frameworks in .NetCore

@yetanotherchris
Copy link
Author

This was the core project that I tried

@negue
Copy link
Contributor

negue commented Jul 25, 2016

I bet you tried the .Net45 Platform, which has Emit in it, better copy .Net45 Platform Code and replace the EmitHandler with the ExpressionReflectionHandler

@yetanotherchris
Copy link
Author

I tried recreating the project as a .netcore one, in Visual Studio 2015 Preview 3 as I couldn't get the upgrade tool working with the LiteDb.Core solution.

It compiled but the tooling is so flakey I eventually gave up. I think to move to .netstandard 1.6 you will need to use a new project with links, and remove the Android/iOS/WUP providers and import System.Cryptopgraphy.Algorithms in the project.json.

It definitely needs knowledge of the code base to do, I wouldn't be confident doing it in a PR. However it shouldn't take more than a few hours max.

@mbdavid
Copy link
Collaborator

mbdavid commented Jul 26, 2016

Hi @yetanotherchris, I tried to do this too, and gave up too. I didnt know deeply this new core world. I will needs study more to try convert. I beleave that, with this new LiteDB.Core solution will not be too complex.

tip: If you are converting, the folder "LiteDB\Platform (https://github.com/mbdavid/LiteDB/tree/master/LiteDB/Platform)" contains all implementations for all platforms. So, in vs project I add/remove according target library. All rest of source are some to all platforms.

@yetanotherchris
Copy link
Author

yetanotherchris commented Jul 28, 2016

I finally managed to get it compiling, after ditching using VS2015 Preview 3 and going back to VS2015 Update 3. I created a brand new .netcore class library, and added PCL as my compilation symbol.

A few things I've noticed:

  • Rijndael doesn't currently have an implementation, or exist as a type. I switched to Aes but it's an abstract class (Aes.Create works however, not sure what it does).
  • type.IsClass - Not in the framework yet as far as I know, so I commented it out.
  • I've no idea how you support 5+ frameworks, it might make sense to have a separate project with linked files.

Anyway this is the project.json if it's any help. I doubt it works! I had to comment out chunks of EmitReflectionHandler

{
  "title": "LiteDB",
  "version": "1.0.0-*",
  "dependencies": {
    "NETStandard.Library": "1.6.0",
    "System.Security.Cryptography.Algorithms": "4.2.0",
    "System.Collections.Specialized": "4.0.1",
    "System.Reflection.Emit.Lightweight": "4.0.1",
    "System.Threading.Thread": "4.0.0",
    "System.Reflection.TypeExtensions": "4.1.0"
  },
  "frameworks": {
    "netstandard1.6": {
      "imports": "netcoreapp1.0"
    }
  },
  "buildOptions": {
    "define": [ "PCL" ]
  }
}

@mbdavid
Copy link
Collaborator

mbdavid commented Jul 28, 2016

Hi @yetanotherchris

  • Rijndael and EmitReflectionHandler are only for dotnet full (must be excluded from .netcore project). Can you use ExpressionRefection in .netcore? I beleave for first version encryption can be out.
  • Is project.json deprecated? I saw in another projects using xproj as new project file format that are not folder based (it's like csproj). Maybe this it's easy to create it.

@yetanotherchris
Copy link
Author

Until Microsoft add Rijndael I'll leave this issue closed.

Project.json still exists, but the tooling update due in Q1 2017 is going to make it obselete. The APIs should also be a lot richer then too, so it's probably not worth doing until Microsoft release the V2 of .NET core instead of the current rushed out version.

@sgrassie
Copy link

sgrassie commented Sep 9, 2016

I know this issue is closed, but: For the last couple of hours I've been working on implementing my own ILitePlatform implementation in an Asp.Net Core app that I'm working on, and I've just got everything in place.

I got the Emit stuff to compile. @yetanotherchris it looks like you were missing "System.Reflection.Emit.ILGeneration": "4.0.1"
Also type.IsClass is now type.GetTypeInfo().IsClass (using "System.Reflection.TypeExtensions": "4.1.0").

As for Rijndael, I just used AES in my IEncryption implementation, it's good enough for my purposes.

@mbdavid
Copy link
Collaborator

mbdavid commented Sep 13, 2016

Hi @sgrassie, did you do Platform Asp.Net core works? Do you want request a PL? I'm stat working in dev branch to next v3 will be .netstandard 1.4 compatible.

@sgrassie
Copy link

I can pull the stuff I've done out and send a PR through, I will sort it
out in the next couple of days.

On Tue, 13 Sep 2016, 11:53 Mauricio David, [email protected] wrote:

Hi @sgrassie https://github.com/sgrassie, did you do Platform Asp.Net
core works? Do you want request a PL? I'm stat working in dev branch to
next v3 will be .netstandard 1.4 compatible.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#219 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAL2XBVr6n0JmUBwU2Fm73kyLMzgoGXwks5qpoCogaJpZM4JUCgb
.

@vfabregat
Copy link

vfabregat commented Sep 16, 2016

While we wait the @sgrassie pull request I did a rapid implementation based on his comment. If anyone need it you can check it here

Regards.

@sgrassie
Copy link

I've not had time to put together a PR, and at the moment it will probably
be next week before I can. The contents of that gist look pretty similar to
what I have written.

On Fri, 16 Sep 2016, 17:00 Victor, [email protected] wrote:

While we wait the sgrassie pull request I did a rapid implementation. If
anyone need it you can check it here
https://gist.github.com/vfabregat/f11c733f574bbb8b799d1c202a16fe09

Regards.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#219 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAL2XEDdbb_6m0mKBoRB5fWUxytHQnR0ks5qqr0FgaJpZM4JUCgb
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants