Repository navigation
Build & Deploy
To build this application with VS Code, you need:
.NET 8.0 SDK + ASP.NET Core Runtime 8
Current tested versions: SDK 8.0.400 + ASP.NET Core Runtime 8.0.8
Current deployed versions: SDK 8.0.412 + ASP.NET Core Runtime 8.0.18
It is also strongly recommended to install:
To run the application, navigate to /MKcards/MKcards.Server and run:
dotnet run --urls "http://127.0.0.1:0" for HTTP
dotnet run --urls "https://127.0.0.1:0" for HTTPS
Alternatively, you can specify a port instead of letting the system pick a free one:
dotnet run --urls "http://localhost:12345"
Note: When the selected port is in use, the build will fail. This will only start the server; the browser will not start automatically. HTTPS consistently throws annoying self-signed certificate warnings.
Navigate to the file /MKcards/MKcards.Server/Program.cs
Click the "Run" icon in the upper right corner:
This will start the server and the default selected browser automatically.
Note: You might see a large number of errors at startup. This can be resolved by loading the
_Imports.razorfile located at:/MKCards/MKCards/MKCards.Client/_Imports.razor.
Deployment has been tested to work with both Visual Studio and purely though the terminal using dotnet. The former provides a intuitive visual interface for the publishing and also provides the convenience of directly uploading files to the server over FTP/FTPS where applicable. The settings used for publishing were:
- Runtime Identifier:
win-x86 - Target Framework:
net8.0 - Self-contained:
true
It may be possible to disable the self-contained option, which will result in a significantly smaller publish folder size, but this requires that runtime dependencies be fully handled by the remote server. The project is configured to accept any 8.0.x version of the ASP.NET runtime so it might be necessary to confirm the exact patch to prevent version mismatch.
During publishing, there should be a prompt to generate the connection string for database access. If not, edit the appsettings.json file located in the root of the publish folder to contain the correct database connection information.
After publishing, to enable logging of server stdout, set the stdoutLogEnabled field to true in the web.config file.
The current command used for publishing:
dotnet publish -c Release -r win-x86 --self-contained true -o ~/path/to/publish-folder