We will be using Visual Studio 2022.
- Install ASP.NET and web development in the Visual Studio Installer.
- Then install Microsoft SQL Server with an installation type of Basic.
- Open the project solution.
- Right click on the project and select Publish -> Folder -> Finish -> Close.
- Click Publish then open the folder.
- Bring the folder into command line, then run the exe with --urls for valid url connections to the website.
e.g../PeerReviewWebsite.exe --urls "http://localhost:8000;http://*:5042"
- Install dotnet SDK (not Runtime) for your distro of Linux.
e.g.sudo apt-get install -y dotnet-sdk-8.0
on Debian based distros - Then install Microsoft SQL Server for Linux for your distro of Linux.
- After it is all installed, run
dotnet publish
in the project folder. - Note the folder listed in the output e.g.
.../bin/Release/net8.0/publish/
. - Move to that folder, and go to Configuring the SQL Server, then continue with the next step.
- Finally, run the executable with --urls for valid url connections to the website.
e.g../PeerReviewWebsite --urls "http://localhost:8000;http://*:5042"
If you have the Microsoft SQL Server set up not with Windows Login, you have the sql server set up with a different name, or are running on Linux, then you will need to change the app configuration.
You will need to edit the appsettings.json
file within the publish directory.
The DefaultConnection
is used for Windows machines, while the LinuxConnection
is used for Linux machines.
You can change to match:
- the credentials by adding a
User Id
, as well as aPassword
if one was set. - the sql server name by changing
Data Source
to that name.
The default config:
...
"ConnectionStrings": {
"DefaultConnection": "Data Source=(local);Initial Catal...",
"LinuxConnection": "User Id=.;Data Source=localhost;Ini...",
},
...