Deploying Razor Pages Demo
This week began with the test deployment of the Razor Pages demo on Azure. Several things were discovered during this process that were not present during the original MVC deployment.
- I am still having issues viewing repositories in the Disco Tray Studios repositories in Github, so I needed to make a fork on Github.
- Whenever I tried to use the default build script generated by Azure, I got the following error:
MSBUILD : error MSB1003: Specify a project or solution file.
The current working directory does not contain a project or solution file.
29
Error: Process completed with exit code 1.
After some discussion in the Teams meeting, I came to discover that this was due to the structure of the repository. Rather than the code being in the base directory, it is stored in a directory within the base level directory. This causes a lot of issues for build pipelines unless you tweak them to use this format.
Initially, I decided to resolve this issue by modifying the build file using a cd
command before the build command.
However, modifying the build script does not give a good example for future projects, as if we use the same template with other pipeline software we will have to also modify those scripts.
Because of this, I decided to restructure the project to eliminate the base level folder and the cd
command in the build script.
Porting Hendrix Assessment to ASP.NET
Porting the Hendrix Assessment frontend webpages to ASP.NET has been relatively easy so far. To port the code over, I first must decide if a Laravel Blade is a section of a shared page. If it is a section of a shared page, I create an associated Razor page in the Shared directory. Examples of these include the general layout blade.
Next, I copy over the blade files into the Razor pages file that I have created. Then, I replace any of the PHP code with C# code. This is because a majority of the page content is in HTML, and only a minority of the code is in PHP that must be replaced. For some of the code such as authentication and databases, I will need to wait until later in the project to connect these up.
Finally, I add the expected ASP.NET front matter to the pages. This includes details such as what layout to use and what title to use.