After the. Net Core Web application is published to IIS, the following error occurs: "An error occurred while starting the application", occurredstarting
An error occurred while starting the application.
. NET Core X64 v4.1.1.0 | Microsoft. AspNetCore. Hosting version 1.1.0-rtm-22752 | Microsoft Windows 6.3.9600
This error is reported, and the Environment is correctly configured according to the official documentation. What should I do?
1. Modify the web. config file and change stdoutLogEnabled to true, as shown below:
<aspNetCore processPath="dotnet" arguments=".\Dialysis.WebApi.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
2. Open the website again and report the above error. Don't worry. Check the root directory of the release and find that there is an additional Logs folder to open the stdout_xxx.log file.
Application startup exception: System. IO. FileNotFoundException: cocould not find file 'G: \ FTP \ DialysisWebApi \ Dialysis. WebApi. xml '.
File name: 'G: \ FTP \ DialysisWebApi \ Dialysis. WebApi. xml'
At System. IO. Win32FileStream .. ctor (String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
At System. IO. Win32FileSystem. Open (String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
At System. IO. FileStream. Init (String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
At System. IO. FileStream... ctor (String path, FileMode mode, FileAccess access, FileShare share)
At System. Xml. XmlSystemPathResolver. GetEntity (Uri uri, String role, Type typeOfObjectToReturn)
At System. Xml. XmlTextReaderImpl. FinishInitUriString ()
At System. Xml. XmlTextReaderImpl .. ctor (String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
At System. Xml. XmlReaderSettings. CreateReader (String inputUri, XmlParserContext inputContext)
At System. Xml. XmlReader. Create (String inputUri)
At System. Xml. XPath. XPathDocument.. ctor (String uri, XmlSpace space)
At Swashbuckle. AspNetCore. SwaggerGen. SwaggerGenOptions. <> c _ DisplayClass24_0. <IncludeXmlComments> B _ 0 ()
At Swashbuckle. AspNetCore. SwaggerGen. SwaggerGenOptions. CreateSwaggerProvider (IServiceProvider serviceProvider)
At Microsoft. Extensions. DependencyInjection. ServiceLookup. CallSiteRuntimeResolver. VisitTransient (TransientCallSite transientCallSite, ServiceProvider provider)
At Microsoft. Extensions. DependencyInjection. ServiceProvider. <> c _ DisplayClass16_0. <RealizeService> B _ 0 (ServiceProvider provider)
At Microsoft. Extensions. Internal. ActivatorUtilities. ConstructorMatcher. CreateInstance (IServiceProvider provider)
At Microsoft. Extensions. Internal. ActivatorUtilities. CreateInstance (IServiceProvider provider, Type instanceType, Object [] parameters)
At Microsoft. AspNetCore. Builder. UseMiddlewareExtensions. <> c _ DisplayClass3_0. <UseMiddleware> B _ 0 (RequestDelegate next)
At Microsoft. AspNetCore. Builder. Internal. ApplicationBuilder. Build ()
At Microsoft. AspNetCore. Hosting. Internal. WebHost. BuildApplication ()
Hosting environment: Production
Content root path: G: \ FTP \ DialysisWebApi
Now listening on: http: // localhost: 22365
Application started. Press Ctrl + C to shut down.
If a file is missing, copy the file to the root directory of the release.
Released to Microsoft IIS official documentation