Learn MS NET | .NET Core

Our journey learning how to write .NET

Learn MS NET

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

Can’t run dotnet in Windows Subsystem for Linux (WSL)


Having installed Bash on Ubuntu on your Windows 10 computer, your now looking to create a new application using .NET Core.You start up a windows command prompt and run the bash command or directly run the Ubuntu command from your Windows menu. Once it is up and running you type in dotnet to create a new project and you receive this.As you can see from the image it says that command not found, this will not work but the problem isn’t that the command doesn’t exists unless the .NET Core SDK is not installed, but that in linux you need to add the .exe extension to your command. If we type in dotnet.exe we will receive the following instead:Now that we have figured out how to launch dotnet in WSL we can continue to develop our application using this framework.

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.

Migrating .NET Core projects


With the pending release of Visual Studio 2017 on March 7, 2017, and the changing format going forward of removing the project.json file to return to the .csproj MsBuild format.  Microsoft has conveniently set up a service to help with migrating your projects to the new format. If you got to http://landinghub.visualstudio.com/migrate-dotnetcore, the .NET Core Engineering team have established a way to ask for help. There are also some links to known migration issues that can be found there as well as a form to fill out requesting help.