我的ASP.NET C#网站部署到IIS时未启动。我按照此页面上的步骤进行操作:
我也尝试将我的应用程序也部署为应用程序。我遇到的问题是该应用程序池最终停止,并且在重新启动应用程序池并进行iis重置时尝试浏览它时,出现错误
无法访问此网站
部署为网站时出现错误代码ERR_CONNECTION_REFUSED。
作为Web应用程序部署时,出现以下堆栈跟踪错误。
我已经在我的应用程序池高级设置中启用了32位应用程序,因为这是x86编译的Web应用程序。它与在连接设置中配置为localhost的数据库有关系。
通过Visual Studio运行我的网站时,包括数据库连接在内都可以正常运行。
使用与部署我的asp.net应用程序相同的步骤来部署简单的HTML应用程序时,网络会向上旋转,甚至可以被外界看到(因此没有防火墙/ IIS问题)。
[BadImageFormatException: Could not load file or assembly 'SolutionsWeb' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +225
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +110
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
System.Reflection.Assembly.Load(String assemblyString) +34
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +48
[ConfigurationErrorsException: Could not load file or assembly 'SolutionsWeb' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +725
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +247
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +157
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +226
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +73
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +319
System.Web.Compilation.BuildManager.ExecutePreAppStart() +170
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +820
[HttpException (0x80004005): Could not load file or assembly 'SolutionsWeb' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688
在事件查看器中进行研究时,应用程序事件日志似乎显示了我的实际问题。这似乎是我需要解决的问题。对于我如何解决此问题的见解,我将不胜感激:
错误:
Faulting application name: w3wp.exe, version: 10.0.17763.1, time stamp: 0xa7ccada2
Faulting module name: clr.dll, version: 4.7.3416.0, time stamp: 0x5cabfd2c
Exception code: 0xc00000fd
Fault offset: 0x0045510d
Faulting process id: 0x2ac4
Faulting application start time: 0x01d55ab8fc19c034
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Report Id: 564020d7-d5f1-44d0-b142-8b56239aabee
Faulting package full name:
Faulting package-relative application ID:
信息:
Login failed for user 'IIS APPPOOL\SolutionsWeb'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
Event ID: 18456
Qualifiers: 49152
Fault bucket 1336845626185276286, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0
Problem signature:
P1: w3wp.exe
P2: 10.0.17763.1
P3: a7ccada2
P4: clr.dll
P5: 4.7.3416.0
P6: 5cabfd2c
P7: c00000fd
P8: 0045510d
P9:
P10:
就像我说的那样,过了一会儿,由于失败,应用程序池停止了,网络完全脱机了。
我们非常感谢您的帮助。谢谢。
答案 0 :(得分:0)
弄清楚了...这是我的数据库连接。我已将其设置为使用win auth,但未授予系统用户安全性。我决定只添加一个Web用户帐户来访问数据库并使用sql auth,该错误消失了。我的网站现在在线。