net core 8 journey

 C:\Users\bende\OneDrive\Projects\preview\hotel----rooms.com   --not pretty got fed up because..

I did do one with controller action already, check on //erasumus

long term reviews > was a chatgpt attempt.

best one is makegtfs - contains a link to https://www.youtube.com/watch?v=J1f5b4vcxCQ&t=612s   - this video suggests all classes be implemented as interfaces from the get go (for testing)


using the code aesthetic idea  https://chatgpt.com/c/66dec509-9174-800c-a9d2-bb3a53a62d85

hotel floor plans is a hybrid vb.net DI and c# frontend.  try on pc in henry's room when ready off eramus preview..  has compile error at this time.



How to setup the standard config


using ubuntu i want to create a new c# 8 solution with mvc site, classlib and be able to run background processes. do i need a console app to do that? what dotnet new command do I issue from the command line

To set up a new C# 8 solution in Ubuntu with an MVC site, a class library, and support for background processes, you'll want to use a combination of the dotnet new commands to create each component. While you don’t necessarily need a console app, creating one can be helpful if your background tasks are going to run outside the context of the MVC site.

Here's how to get started:

  1. Create a New Solution:


    dotnet new sln -n YourSolutionName
  2. Create an MVC Project:


    dotnet new mvc -n YourMvcProject

    This will create an ASP.NET Core MVC project.

  3. Add the MVC Project to the Solution:


    dotnet sln add YourMvcProject/YourMvcProject.csproj
  4. Create a Class Library:


    dotnet new classlib -n YourClassLib

    This library can hold shared models, services, or any other code that you want to use across your application.

  5. Add the Class Library to the Solution:


    dotnet sln add YourClassLib/YourClassLib.csproj
  6. (Optional) Create a Console App for Background Processing: If you want to run background processes independently of the MVC site, a console app is a good way to manage these tasks. Create a console app by running:


    dotnet new console -n YourBackgroundWorker

    This project can be used to handle background processes, such as data processing or periodic tasks.

  7. Add the Console App to the Solution:


    dotnet sln add YourBackgroundWorker/YourBackgroundWorker.csproj
  8. Reference the Class Library in the MVC Project and Console App:


    dotnet add YourMvcProject/YourMvcProject.csproj reference YourClassLib/YourClassLib.csproj dotnet add YourBackgroundWorker/YourBackgroundWorker.csproj reference YourClassLib/YourClassLib.csproj
  9. Run the Solution: To start the MVC site:


    dotnet run --project YourMvcProject

    To start the console application (for background processing):


    dotnet run --project YourBackgroundWorker

Using this structure, you have a flexible solution with a web app, shared code in a library, and an optional console application for background tasks. The MVC project itself could also host background processes by using hosted services if you prefer that approach.



How to run the apps in the solution



To view and edit your new solution in Visual Studio Code, follow these steps:

  1. Open the Solution in Visual Studio Code:

    • Navigate to the root directory of your solution (where your .sln file is located).
    • Open Visual Studio Code from this directory by running:

      code .
  2. Install Recommended Extensions: For C# development in VS Code, you'll want to install some extensions for a better experience:

    • C# for Visual Studio Code (powered by OmniSharp): This provides C# IntelliSense, debugging, and project management.
    • .NET Core Test Explorer (optional): If you have tests, this extension helps you run them within VS Code.

    When you open the project, VS Code will often prompt you to install recommended extensions for C#. Follow the prompts or manually install them from the Extensions sidebar.

  3. Workspace Setup:

    • When you open VS Code, it will recognize your .sln file. This allows you to work with all the projects within your solution from a single VS Code workspace.
    • If you don't see all projects in the Explorer, make sure the workspace folder is open at the solution level, not within a specific project subfolder.
  4. View and Edit Project Files:

    • You can navigate through your project files using the Explorer sidebar in VS Code.
    • Open files to view and edit them as you would with any text editor.
  5. Run and Debug:

    • In the Run and Debug sidebar (or press F5), you can configure launch settings for your projects.
    • If you opened the MVC project (YourMvcProject), VS Code should detect it as an ASP.NET Core project and set up a default debug configuration.
    • For the console app (YourBackgroundWorker), select it as your active project from the Run and Debug sidebar and configure any custom settings if needed.
  6. Build and Run from the Terminal:

    • In VS Code, open a terminal (View > Terminal or `Ctrl+``) and run commands directly:
      dotnet build
      dotnet run --project YourMvcProject dotnet run --project YourBackgroundWorker
  7. IntelliSense and Editing:

    • With the C# extension installed, VS Code provides IntelliSense and autocompletion for your C# code.
    • You can also use features like Go to Definition, Peek Definition, and Find All References, which help you navigate your codebase.
  8. Tasks and Commands:

    • VS Code's command palette (accessible with Ctrl+Shift+P) can be used to run tasks like build, run, and test.
    • Alternatively, you can create a tasks.json file under the .vscode folder for custom build/run tasks.

Chrome Certificate Errors



google-chrome --ignore-certificate-errors --user-data-dir="/tmp/chrome_dev"   will launch a chrome that doesn't moan about the localhost cert.


There are other ways to permanently fix this, but not today.

Comments

Post a Comment

Popular posts from this blog

Tutorials on Unity Probuilder and Progrids

difference between field and property in c#