Skip to main content

Posts

Showing posts with the label .NET Core

ASP.NET Hosting Common Errors

  Troubleshooting common hosting issues In this section, we will look into some of the common problems that you can face while hosting a Blazor application. If you are unable to open the website and get a DNS not found error Check if the hostname is configured correctly in the host file. Make sure that your machine is not connected to any VPN server. Also, if you are using any Web proxy then disable it. HTTP Error 500.19 – Internal Server Error - The requested page cannot be accessed because the related configuration data for the page is invalid. This error message is clear. The publish folder is inaccessible because of insufficient permissions. Grant Read permission to the IIS_IUSRS group on the publish folder so that it can access Web.config file. If the website is loading but data is not getting populated and you get a 500 Internal server error Make sure that your connection string is in the correct format. The user id that you have specified in your connection string should hav...

Erros in .NET Core - Web Application

 Brief Contains all the errors occurred for me while working with .NET Core Web Application. HTTP Error 500.24 - Internal Server Error -  An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. This happens when running new created .net core - web application from the visual studio. fig. Error Solution1: Simply run your application from command line.  Solution2: Simply use your project name instead of the IIS Express and run your project.

Add Swagger To Asp.Net Core Rest API

Brief Add SwaggerGen to the services collection in the Configure method, and in the ConfigureServices method, enable the middleware for serving generated JSON document and the SwaggerUI. public void ConfigureServices ( IServiceCollection services ) { // Add framework services. services . AddMvc (); services . AddLogging (); // Add our repository type services . AddSingleton < ITodoRepository , TodoRepository >(); // Inject an implementation of ISwaggerProvider with defaulted settings applied services . AddSwaggerGen (); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory ) { app . UseMvcWithDefaultRoute (); // Enable middleware to serve generated Swagger as a JSON endpoint app . UseSwagger (); // Enable middlewar...

Copy and Replace the .dll and .pdb file to the specified folder

Brief Solution copy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)HP.EMEA.Web\App_Data\Dependencies\$(ProjectName).dll" copy /Y "$(TargetDir)$(ProjectName).pdb" "$(SolutionDir)HP.EMEA.Web\App_Data\Dependencies\$(ProjectName).pdb" copy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)HP.EMEA.Web\bin\$(ProjectName).dll" copy /Y "$(TargetDir)$(ProjectName).pdb" "$(SolutionDir)HP.EMEA.Web\bin\$(ProjectName).pdb"