This is quick blog post about stopping executing void method. So, how to stop executing void return type method? We just need to use ‘return’ statement itself, for example: If we pass 0 as first argument then we won’t get print from next line.
Author Archives: Karol N
Run a site using the IIS Express in command line
Useful when we are writing tests and working with Selenium, and we want to inspect some element on page with DevTools. Open a command prompt and run the following command with appropriate paths: This command runs the app on http://localhost:9777
Problem with correctly display Razor Pages with IdentityServer
I had problem with login/registration pages UI looks. And problem was with lacking of app.UseStaticFiles(); in Configure method of Startup class. UI before changes: So to solve these errors we need add “app.UseStaticFiles();” in Startup.cs. Changes in Startup.cs, Configure method: UI after changes: Now it looks a little better 🙂
IdentityServer configuration to use it with SPA that is not hosted with IdentityServer
IdentityServer settings configuration to use it with SPA that is not hosted with IdentityServer. For example, we have client app on http://localhost:4200 and backend app on https://localhost:5001. To allow working it, we need to set/change “Profile” to “SPA”. Additional we can configure “RedirectUri” and “LogoutUri”. Backend side (.NET Core 3.1).Code snippet of appsettings.json:
Angular Auth 404 (Not Found)
I have frontend app wrote in Angular on localhost:4200 and backend in C#, .NET Core on localhost:5001. I had problem with 404 errors and solution is below. It is resolving my two problems, one to gets data from my controllers and second to repair auth functionality. GET http://localhost:4200/_configuration/* 404 (Not Found)e.g.:GET http://localhost:4200/_configuration/crypto-web-app 404 (Not Found)Continue reading “Angular Auth 404 (Not Found)”
Git – removing password, sensitive data from older commits (history)
In a nutshell: If you have inadvertently committed confidential data, e.g. passwords, there is a way to delete this information from git commits history. I use BFG Repo-Cleaner that you can download from: https://rtyley.github.io/bfg-repo-cleaner/ Before any steps please make a backup of your repo to ensure you don’t lose anything. I show example commits andContinue reading “Git – removing password, sensitive data from older commits (history)”
OperationalStoreOptions in xUnit
I had little issue with creating IOptions<> to use it with xUnit, so below is solution: var operationalStoreOptions = Options.Create(new OperationalStoreOptions()); Example usingConstructor in my class with DbContext looks like: Corresponding lines of code in my xUnit test class:
Terminating process that occupy the specific port
In a nutshell: This post is about kill the process that occupying port that we want to use. Sometimes when you developing app on your local machine you can encounter port blocked. In my cases, these were ports 4200 and 5001. For example after using ng start command for start Angular frontend application or dotnetContinue reading “Terminating process that occupy the specific port”