Code Monkey home page Code Monkey logo

csharp-microservices's Introduction

Microservices on ASP.NET 8.0

The course has some drawbacks, mainly the .NET version its based on. Since I program on Linux, I've found myself some shortcommings that I'd like to write down in the remote case anyone is in a similar situation or setup as mine.

Setting up .NET 8.0 SDK

You'll need, first of all, the SDK and run-times that the course is based on. Luckily, Microsoft offers a handy script that basically downloads all the .rpms you'll need and installs them for you. I cannot find the page that I found the script but you can download it here

However, when executing the script, you may encounter some issues if you already have installed previous versions. At time of writing this, the LTS and Standard versions are 6.0 and 7.0 respectively.

For those of you running Fedora Workstation, you'll be glad to know you can cd to the directory where all the .rmps are and run sudo yum localinstall * --allowerase. Which will remove the dependencies that you have in place for the 8.0 preview.

NuGet Packet Manager "workarounds"

You'll be able now to use dotnet restore succesfully. Although there are some other issues we have to attend first.

If you are using Linux like me, doing things like migrations, database updates and other shennanigans that use the NuGet packet manager available in Visual Studio, you'll need to install globally available tools since it relies on EntityFramework and I'm using Neovim we'll have to use the good ol' CLI to accomplish the same tasks

Environment variables

Now we can use dotnet user-secrets init so we create a secrets.json that can be called anywhere in the project where we need. We should add our connection string first so we can create our first migration and update the SQL table.

Database=master; User=sa; Password=pwd; TrustServerCertificate=true;" ```

We should `dotnet clean && dotnet build` for good measure and run:

``` dotnet ef migrations add <MigrationName> dotnet ef database update ```

If all went well, we should see a succesfull message on our CLI.

csharp-microservices's People

Contributors

concienciadesventurada avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.