Tag Archives: asp.net

[Solved] asp.NETCORE connect to MySQL error: encoding 1252

The error information is as follows:

System.NotSupportedException:“No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.”

Solution:

Add system.Through.nuget.Text.Encoding and system.Text.Encoding.References to codepages

Then add the following code to the code

System.Text.EncodingProvider ppp = System.Text.CodePagesEncodingProvider.Instance;
Encoding.RegisterProvider(ppp);

OK solve the problem

IIS Web Deploy Website Error: HTTP error 500.19 – Internal Server Error

HTTP error 500.19-Internal Server Error
The requested page cannot be accessed because the relevant configuration data for the page is invalid.

Detailed error information:

Module: IIS Web Core
Notice: BeginRequest
error code: 0x800700b7
Configuration error: When the unique key attribute “name” is set to “ScriptHandlerFactory”, duplicate collection items of type “add” cannot be added
Because the child site inherits the web.config of the parent site

Because the child site inherits the web.config of the parent site

  <location path="." allowOverride="true" inheritInChildApplications="false">
  /* Wrap <system.web> with location in the web.config file
    </system.web>
*/
// If it doesn't work, wrap all configurations with the <add> attribute in location
 
  </location>

For example: system.web, system.webServer, ApplicationConfiguration and other configuration
locations with add attributes only need to be written once

Make the subsite not inherit the web.config of the parent site

[Solved] net core HTTP Error 500.31 – Failed to load ASP.NET Core runtime HTTP Error 500.30 – ASP.NET Core

Question 1:

HTTP Error 500.31 – Failed to load ASP. NET Core runtime
Common solutions to this issue:
The specified version of Microsoft. NetCore. App or Microsoft. AspNetCore. App was not found.
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process’ stdout messages
Attach a debugger to the application process and inspect

reason

Cause of failure:
when the machine is published NETCORE version and server NETCORE version is inconsistent

Solution:
modify the published NETCORE version

Or synchronize the server’s environment download NET 5.0 (Linux, macOS, and Windows)

Question 2:

HTTP Error 500.30 – ASP. NET Core app failed to start
Common solutions to this issue:
The app failed to start
The app started but then stopped
The app started but threw an exception during startup
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process’ stdout messages
Attach a debugger to the application process and inspect

So I checked the event viewer & gt; Windows Log & gt; Appliction> The first time I checked the error log, I checked the following logs. I thought it was a CLR problem. After tossing around, I found that the problem was not solved.

Redis did not start and lost…

Then the most important thing is that all browsers are closed. It’s a little pit. It seems to occupy the port

Application specific permission settings do not grant the user NT service\SQLServerAgent in the address localhost (using LRPC) running in the application container unavailable Sid (unavailable) local activation permission for the COM server application with CLSID. This security permission can be modified using the component service management tool- Blue street lamp blog Garden

[Solved] Error: Another program is already listening on a port that one of our HTTP servers is configured to

Question

    1. Step 1 run
supervisord  -c /etc/supervisor/supervisord.conf

Error

Error: Another program is already listening on a port that one of our HTTP servers is configured to

Solution:

ps -ef | grep supervisord

Turn off the 8079 process

kill -s SIGTERM 8079  

Solution results

supervisord  -c /etc/supervisor/supervisord.conf

No error is the best case, indicating that the process is started successfully

Stackexchange.redis data timeout [How to Solve]

StackExchange.Redis Error when loading large batch of hash data.
StackExchange.Redis.RedisTimeoutException: Timeout performing HGET Cache.IncomeShare.AccountData@Cache.IncomeShare.AccountData.InnerIncomeDistributionItem, inst: 1, mgr: ExecuteSelect, err: never, queue: 2, qu: 0, qs: 2, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: xx, serverEndpoint: 192.0.x.x:6379, keyHashSlot: 10857, IOCP: (Busy=0,Free=1000,Min=6,Max=1000), WORKER: (Busy=0,Free=32767,Min=6,Max=32767) (Please take a look at this article for some common client-side issues that can cause。 timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts)
According to the information to see IOCP and WORKER Busy are 0, will also report a timeout problem, is expected to be a StackExchange.Redis bug, the solution can be changed to use FreeRedis.

Error handling when ABP specifies map object during map operation

Error handling in map operation of ABP

When mapping an entity object into dto in ABP, the entity defines an object of type long. In dto, there is an object with the same name, but the type is guid,

// StudentEntity
public class StudentEntity
{
		public Guid RelatedStudentId
		{
				get; set;
		}
}

// StudentDto
public class StudentDto
{
		public Guid StudentId
		{
				get;  set;
		}
		
		public Long RelatedStudentId
		{
				get; set;
		}
}

Take studententity and studentdto for example. Due to the change of business, when the back-end modifies the database and does not change the front-end code for the time being,

Directly map the relatedpatientid in entity to the studentID in dto , In this way, an error will occur when mapping, indicating that the type conversion error is wrong, and the data of the guid cannot be assigned to long,

CreateMap<StudentEntity, StudentDto>()
            .ForMember(d => d.StudentId, map => map.MapFrom(o => o.RelatedStudentId))

At this time, the entity’s guid type relatedpatientid will be mapped to the long type relatedpatientid in dto,

This kind of data definition should be avoided in map operation.

Generate template asp.net Cs1010: newline in constant

compiler error message: CS1010: constants of line breaks
the source error:

Solutions:
Method 1: Open the corresponding template that will prompt “inconsistent line end “, select” Yes “, save → generate
Method 2: When you have written the template, press the formatting code shortcut key Ctrl+K+D

>

Vs 2015 IIS express debug error: http error 401.2 – unauthorized

Interface was developed using VS2015. After running the back-end API in debug mode, Postman called the interface and sent back an error message:
< title> IIS 10.0 Detailed error-401.2-unauthorized< /title>
< h4> The most likely reason :& Lt; /h4>
& lt; ul>
& lt; li> No authentication protocol (including anonymity) was selected in IIS. < /li>
& lt; li> Only integrated authentication is enabled, and the client browser used does not support integrated authentication. < /li>
& lt; li> Integrated authentication is enabled, and the request is issued through a proxy, but the proxy changes the authentication header before the request reaches the Web server. < /li>
& lt; li> The Web server is not configured for anonymous access and does not receive the required authorization headers. < /li>
& lt; li>” The configuration/system. WebServer/authorization “configuration section may explicitly rejected the user access. < /li>
& lt; /ul>
Solution: Project – Properties – Anonymous Authentication – has been enabled

HTTP error 405.0 – method not allowed solution for put and delete operations of rest Service on iis7.5

The Put and Delete operation of REST service on IIS7.5 occurs HTTP Error 405.0-method Not Allowed

WebDAV is a set of extensions to the hypertext transfer protocol (HTTP) that provide standards for editing and file management between computers on the Internet. Using this protocol, users can perform remote basic file operations, such as copying, moving, deleting, etc., over the Web. In IIS 7.0, WebDAV is a stand-alone extension module that needs to be downloaded separately. In IIS 7.5, WebDAV will integrate WebDAV, but WebDAV puts and Deletes. So the RESTful Service deployed on IIS 7.5 (WCF Data Service, WCF Rest Service,ASP.NET Web API,ASP.NET MVC) is a tragedy. HTTP Error 405.0 — Method Not Allowed occurs when a Put request is sent.

< system.webServer>  

& lt; modules>  

& lt; remove name=”WebDAVModule” />  

& lt; /modules>  

& lt; handlers>  

& lt; remove name=”WebDAV” />  

& lt; /handlers>  

< /system.webServer>

ASP.NET Parser Error Message: Could not load type ‘Web.Global’.

Server Error in ‘/myapp’ Application.


Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.  

Parser Error Message: Could not load type ‘Web.Global’.

Source Error: 

Line 1:  <%@ Application Codebehind="Global.asax.cs" Inherits="Web.Global" Language="C#" %>

The Source File:/ierp2/global asax
The Line: 1.


Version Information: Microsoft.net Framework Version:4.0.30319; ASP.NET Version: 4.0.30319.1

The Web project referred to other class projects. When I opened Bin, it was empty. I just remembered that I had implemented the cleaning solution when I did the backup before, but I did not regenerate it this time.