Learn MS NET | ASP.NET

Our journey learning how to write .NET

Learn MS NET

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

IdentityUI has a breaking change in .NET Core 3.0


With ASP.NET Core 3.0, Identity UI was moved to use the new static web assets introduced in this version. With this move there are some breaking changes to be aware of:.AddDefaultUI(UIFramework.Bootstrap4) no longer works.With the new change Bootstrap 4 is now the default UI Framework for use with Identity UI. If you are in need of using an older version of the framework then this can be done by using the IdentityUIFrameworkVersion property in your project file.The overload for AddIdentityUI that took a UIFramework parameter no longer exists in the latest versions of 3.0. If you are using Bootstrap 4, simply call AddIdentityUI(). If you need to use Bootstrap3, add the following line to your project file inside a PropertyGroup.<IdentityUIFrameworkVersion>Bootstrap3</IdentityUIFrameworkVersion>As I find more changes they will be posted here.

HTTP Error 500.30–ANCM In-Process Start Failure


While preparing an app to run on my local IIS server for the first time I received this error. It provides some clues as to what is happening but does not give a direct cause and can be very frustrating when trying to get that app ready for production.HTTP Error 500.30 - ANCM In-Process Start FailureCommon causes of this issue:The application failed to start The application started but then stopped The application started but threw an exception during startupTroubleshooting steps:Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspectFor more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265The page that we receive here basically takes us to the standard installation for the ASP.NET Core Module, which may be a good place to start to see if there was a misconfiguration when the module was installed.Now if the issue continues there are some ways to determine what the issue isCheck Application Event LogAccess the Application Event Log:Open the Start menu, search for Event Viewer, and then select the Event Viewer app. In Event Viewer, open the Windows Logs node. Select Application to open the Application Event Log. Search for errors associated with the failing app. Errors have a value of IIS AspNetCore Module or IIS Express AspNetCore Module in the Source column.Run the app at a command promptMany start-up errors don’t produce much useful information in the Application Event Log. Another option is to run the app at a command prompt on the hosting system if there is access to do that.Framework-dependent deploymentIf the app is deployed as framework-dependent:At a command prompt or PowerShell window, navigate to the folder that contains the app and launch the app by executing the assembly with dotnet.exe. dotnet .\<assembly_name>.dll – substitute <assembly_name> with the name of the applicationIn the console window, if there are any errors they will written in the output.If the errors only occur when making a request to the app, launch a browser and make a request to the app. Usually this will be at http://localhost:5000/. If the app responds normally with no error, the problem more likely related to the hosting configuration and not the app.Self-contained deploymentIf the app is deployed as self-contained then follow the above steps substituting <assembly_name>.exe for dotnet .\<assembly_name>.dll and follow the rest of the steps.ASP.NET Core Module stdout logTo enable and view stdout logs:Navigate to the app folder on the host system.If the logs folder isn’t present create the folder.Edit the web.config file. Set stdoutLogEnabled to true and change the stdoutLogFile path to point to the logs folder (for example: .\logs\stdout) stdout in the path is the log file name prefix.Ensure your application pool’s identity has write permissions to the logs folder.Save the updated web.config file.Make a request to the app or site.Look in the logs folder and find the latest log file.Check the file for errors.Once trouble shooting is complete make sure to turn off logging in the web.config file by setting stdoutLogEnabled to falseHopefully this helps solve your issue.

How to serve files without extensions in IIS


By default, IIS will not serve up files without an extension. Never the less sometimes we need to allow IIS to serve up these files.The following web.config file can be placed in the directory that you want to serve up these files from.<?xml version="1.0" encoding="UTF-8"?>    <configuration>         <system.webServer>             <staticContent>                 <clear />                 <mimeMap fileExtension="." mimeType="*/*" />             </staticContent>         </system.webServer></configuration>The mimeType can be adjusted to allow a specific type of file to be downloaded from the server as well.