1

I have a web application was running on IIS 6.0 and was targeting .Net Framework 4.6.1. I have recently upgraded IIS to version to and I have installed .Net Framework 4.8 both on my development machine and my web server. I have confirmed that version 4.8 is running on the server by following the steps outlined here. I also made sure to change the Target Framework to 4.8 by going to the project property pages. After creating a new application in IIS 10 and moving the published files to the directory, I visit the application URL to find the following error:

BC31007: Unable to open module file 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.0.vb': System Error &Hc0000005& (Visual Basic internal compiler error)

c:\windows\system32\inetsrv> "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe" /t:library /utf8output /R:"C:\windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_64\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\assembly\dl3\56a54d06\835fed79_c7a0d601\App_Web_the_application_page.aspx.cdcab7d2.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\assembly\dl3\4c4b96c5\b638438d_bca0d601\Interop.IWshRuntimeLibrary.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /out:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.dll" /D:DEBUG=1 /debug+ /nowarn:41008,40000,40008 /define:_MYTYPE="Web" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /warnaserror- /optionInfer+ "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.0.vb" "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.1.vb"

Microsoft (R) Visual Basic Compiler version 14.8.3761 for Visual Basic 2012 Copyright (c) Microsoft Corporation. All rights reserved.

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to Visual Basic 2012, which is no longer the latest version. For compilers that support newer versions of the Visual Basic programming language, see http://go.microsoft.com/fwlink/?LinkID=533241

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.0.vb : error BC31007: Unable to open module file 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.0.vb': System Error &Hc0000005& (Visual Basic internal compiler error) C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.1.vb : error BC31007: Unable to open module file 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\the_application\0d68bd1e\5c2220e1\App_Web_the_application_page.aspx.cdcab7d2.foubj9oz.1.vb': System Error &Hc0000005& (Visual Basic internal compiler error)

I have also made sure to Enable Directory Browsing for the application in IIS. Any help on this is greatly appreciated.

~Billy

billy_blanks
  • 105
  • 1
  • 3
  • 12
  • IIS upgrade requires a windows system upgrade. Before Windows XP is iis6, and iis10 requires at least Windows8, did you upgrade iis to replace a device, copy the original application directly to the new device and compile and run it directly? Another point is whether your application has been tested in a test environment and can it run normally? If you deploy directly to a new production environment without testing, it is difficult to find problems. – Bruce Zhang Oct 13 '20 at 06:57
  • Thank you for your comment Bruce. What I did was create a new 2016 server and in Visual Studio 2019, I compiled the new code and copied it over to the new web server. I made sure to run the new 4.8 code in Visual Studio debug mode before doing the copy to the server. In debug mode everything appears fine in the browser. I notice the issue when I try to visit the code while it is on the server. – billy_blanks Oct 13 '20 at 14:23
  • 2
    I suggest you try to change the identity of the application pool to the local system. If it still cannot work, you can raise a support ticket:https://support.microsoft.com/ – Bruce Zhang Oct 14 '20 at 09:27
  • That did the trick. Thank you Bruce! – billy_blanks Oct 19 '20 at 21:35
  • You can mark the answer so that it can help others with similar problems. – Bruce Zhang Oct 20 '20 at 08:35

1 Answers1

3

Switching the identity of the application pool to the local system will raise the authority of the application pool to the highest level, which can solve the problem well.

Bruce Zhang
  • 2,880
  • 1
  • 5
  • 11
  • This worked for us, after a Windows Update this week broke our long-established (as in, approaching 20 years) apps. An extremely stressful evening was spent trying to find a resolution, so this really saved us a long sleepless night. What I'd really like to know is why Microsoft have shifted the system so that AppPools that were working happily under ApplicationPoolIdentity now had to all be edited and set as LocalSystem. We can't have been the only IIS server to have experienced this major screw-up. – Alec MacLean Jul 18 '23 at 14:34