GithubHelp home page GithubHelp logo

Nuget Update? about brightstardb HOT 14 CLOSED

dgerding avatar dgerding commented on June 10, 2024 1
Nuget Update?

from brightstardb.

Comments (14)

kal avatar kal commented on June 10, 2024 1

Hi Dave!

I'm struggling a bit with the Roslyn code generator ATM because the .NET Core environment has massively shaken things up and a lot of things that "just worked" with T4/roslyn in a pre .NET Core world now crash and burn in the World We Are Given By Microsoft.

I think that thanks to Buildalyzer I may now be getting there, but its a bit of a slog and I reallly don't want a public release of B* without our code generation sauce on top.

Thanks for sticking with it, Hopefully won't be long now!

Cheers

Kal

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

Just checking in... Any eta?

from brightstardb.

kal avatar kal commented on June 10, 2024

There is an alpha of the packages BrightstarDBLibs, BrightstarDB.CodeGeneration and BrightstarDB.CodeGeneration.T4. I'll update the BrightstarDB package soon to bring it up to the same version number - I just want to work out how to automate that.

Any feedback on the packages - especially the code generation ones - would be really welcome.

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

I'll try and give useful feedback when I can. So far I just had time to build and try and run tests. All 22 code-gen tests pass, which I assume you see, too.

FYI, when I try and build the Samples EntityFramework solution I get a build error on all the projects where it can't seem to find anything in the B* EntityFramework namespace. Tried building after adding file reference to net451 dll and using Nuget latest for the external assemblies like Remotion, etc.. Not sure what I'm doing wrong there but figured I'd mention it.

Will get back with something useful as soon I can. Thanks for all the forward motion on this and wish I could be a better help. It's a big stack!

from brightstardb.

kal avatar kal commented on June 10, 2024

Thanks @dgerding . I haven't started to look at the samples yet, but they are all so old I suspect that they probably will need a bit more than just an update of the NuGet dependencies. It would be good to know how the update works for your own project.

BTW the code generation is now purely Roslyn with an MSBuild task. I haven't updated the documentation yet, but I would recommend that you first remove all BrightstartDB.* nuget references from your project and then add either BrightstarDB (if you want the code generation) or BrightstarDBLibs (for just the core library without code gen) to your project using the latest published alpha release (alpha03).

Cheers

Kal

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

Hi @kal,
I figured I'd take a crack at converting the samples to the new code since that might be within my abilities :) I also figured I would target .net core console since the updates you've made should now reach an even broader build target, which is cool. So the samples should run as console apps "just about anywhere."

I started before I got this. Should I use alpha03 or the latest develop build? Also, can you give me the quickest hint/how to invoke the msbuild task instead of the tt/t4 process to generate the entity context code?

Really grateful and excited to see this all refreshed etc...

Dave G

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

Also happy to help with some documentation editing. I have a long history in tech writing.

from brightstardb.

kal avatar kal commented on June 10, 2024

Hi @dgerding ,

Thanks for the offers! It would be great to get the samples updated / expanded.

With regards to the MSBuild process all you need to do is include the BrightstarDB.CodeGeneration NuGet package in your project (this is automatically pulled in if you install the BrightstarDB package). It adds a hook that runs on compilation and generates the entity context file. By default it generates a class named EntityContext and puts it into a file named EntityContext.cs in the root namespace of your project, but you can tweak that by defining any/all of the following properties in your .csproj/vbproj file:

  • EntityContextNamespace - the full namespace for the generated entity context class
  • EntityContextClassName - the name of the generated entity context class
  • EntityContextFileName - the name of the file containing the generated entity context class. This can be a relative path starting from the project root directory.

And yes, please use the alpha03 release and NuGet package references for the samples, that way we can make the build experience for users who want to play with the samples as easy as possible.

Cheers

Kal

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

Hi @kal,
I tried creating both .net standard and .net core projects for GettingStarted in the EntityFramework samples solution. This seemed like a good place to start.

In both cases I'm getting "chicken and egg'd" where the solution won't build due to a missing EntityContext. I assumed the [Entity] attributes in IActor and IFilm would trigger the MSBuild process to generate EntityContext class but it's not happening for me so far.

I used file-based references to BrightstarDB and BrightstarDB.CodeGeneration since I don't know how to include the nuget package out of the src solution/path. Maybe that's the problem?

To be clear, the only build errors I have now (in the two new GettingStarted projects) are about the missing EntityContext. I tried commenting out any code that referenced the entity context, leaving just the Entity attribute files, figuring the MSBuild process would trigger, but that didn't work.

I've zipped up the EntityFramework Samples Solution I was trying to get working.

Sorry to need so much help but I should be able to move ahead quickly when I get past these basics.

Dave
EntityFramework.zip

from brightstardb.

kal avatar kal commented on June 10, 2024

Hi @dgerding,

If you are using Visual Studio it should be pretty straightforward.

First you need to remove those assembly dependencies. Expand the References (under the project in the Solution Explorer tab) and delete BrightstarDB and BrightstarDB.CodeGeneration.

Second if this is an old project that you are updating you also need to delete the EntityContext.tt file so that it doesn't clash with the new EntityContext.cs file that the code generator will create.

Third you need to add the NuGet Packages. Right-click on the project in the Solution Explorer and select Manage NuGet Packages. In the window that is displayed, click on the Browse tab and then enter BrightstarDB into the search box and check the "Include preleases" checkbox. This should find several packages. The only one you need to install is the BrightstarDB package, this includes both the core libs and the code generation.

Once that is complete, you should be able to compile the project successfully (note that the compilation will now be a bit slower because of the additional code-generation step).

Hope that helps!

Cheers

Kal

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

Hi @kal,
I didn't realize the alpha bits were on pre-release nuget - that I know how to do :) I thought there was some "local nuget reference" being recommended that I didn't know. I'll give this a try asap.

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

@kal,
Existing samples are converting to new code nicely and quickly. I expect to do a PR later today with the revised samples.

Dave

from brightstardb.

dgerding avatar dgerding commented on June 10, 2024

@kal,
I'm pretty far through converting the old NerdDinner ASP.NET MVC sample to ASP.NET Core 2.2 MVC and realized I better clarify the goals of this example before I proceed:

  • Do you want the user identity info stored in B*? I'm assuming yes since it might be nice to demo a single persistence mechanism. ASP.NET Core doesn't have the ASP.NET Membership approach anymore, but I'm pretty sure I can convert the old user behaviors from the example to the newer Identity mechanism using B* as a custom data store.
  • What were/are the other goals for this example? (I'm getting a runtime error when I try and run the old version of the project so I'm inferring agenda from code)

Also, as indicated, the other samples are all running. Naturally, I didn't try and update the WP7 and WP8 projects.

Dave

from brightstardb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.