sirclesadmin
a year ago
IIS error after moving from 2012 R2 to 2022 server:

Log Name:      Application
Source:        ASP.NET 4.0.30319.0
Date:          19/05/2023 12:54:47
Event ID:      1310
Task Category: Web Event
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      IIS
Description:
Event code: 3007 
Event message: A compilation error has occurred. 
Event time: 19/05/2023 12:54:47 
Event time (UTC): 19/05/2023 11:54:47 
Event ID: ba93839f28da42dc977941ee1fc3703c 
Event sequence: 3 
Event occurrence: 1 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/2/ROOT-3-133289704564140566 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: C:\Websites\Site\ 
    Machine name: IIS 
 
Process information: 
    Process ID: 4816 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\Site UK 
 
Exception information: 
    Exception type: HttpCompileException 
    Exception message: C:\Websites\Site\App_Code\Startup.Auth.vb(13): error BC30451: 'DefaultAuthenticationTypes' is not declared. It may be inaccessible due to its protection level.
   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed)
   at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories)
   at System.Web.Compilation.BuildManager.CompileCodeDirectories()
   at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
   at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

 
 
Request information: 
https://www.site.suffix:443/  
    Request path: / 
    User host address: IP 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: IIS APPPOOL\Site UK 
 
Thread information: 
    Thread ID: 8 
    Thread account name: IIS APPPOOL\Site UK 
    Is impersonating: False 
    Stack trace:    at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed)
   at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories)
   at System.Web.Compilation.BuildManager.CompileCodeDirectories()
   at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
   at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
 
 
Custom event details: 

Event Xml:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ASP.NET 4.0.30319.0" />
    <EventID Qualifiers="32768">1310</EventID>
    <Level>3</Level>
    <Task>3</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2023-05-19T11:54:47.235963200Z" />
    <EventRecordID>242</EventRecordID>
    <Channel>Application</Channel>
    <Computer>IIS</Computer>
    <Security />
  </System>
  <EventData>
    <Data>3007</Data>
    <Data>A compilation error has occurred.</Data>
    <Data>19/05/2023 12:54:47</Data>
    <Data>19/05/2023 11:54:47</Data>
    <Data>ba93839f28da42dc977941ee1fc3703c</Data>
    <Data>3</Data>
    <Data>1</Data>
    <Data>0</Data>
    <Data>/LM/W3SVC/2/ROOT-3-133289708858140566</Data>
    <Data>Full</Data>
    <Data>/</Data>
    <Data>C:\Websites\Site\</Data>
    <Data>IIS</Data>
    <Data>
    </Data>
    <Data>4816</Data>
    <Data>w3wp.exe</Data>
    <Data>IIS APPPOOL\Site UK</Data>
    <Data>HttpCompileException</Data>
    <Data>C:\Websites\Site\App_Code\Startup.Auth.vb(13): error BC30451: 'DefaultAuthenticationTypes' is not declared. It may be inaccessible due to its protection level.
   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed)
   at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories)
   at System.Web.Compilation.BuildManager.CompileCodeDirectories()
   at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
   at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

</Data>
    <Data>https://www.berkshire-computers.co.uk:443/</Data>
    <Data>/</Data>
    <Data>IP</Data>
    <Data>
    </Data>
    <Data>False</Data>
    <Data>
    </Data>
    <Data>IIS APPPOOL\Site UK</Data>
    <Data>8</Data>
    <Data>IIS APPPOOL\Site UK</Data>
    <Data>False</Data>
    <Data>   at System.Web.Compilation.AssemblyBuilder.Compile()
   at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
   at System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed)
   at System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories)
   at System.Web.Compilation.BuildManager.CompileCodeDirectories()
   at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
   at System.Web.Compilation.BuildManager.CallAppInitializeMethod()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
</Data>
  </EventData>
</Event>

Sponsor

Want to thank us? Use: Patreon or PayPal or Bitcoins: bc1q4whppe29dw77rm4kv4pln0gqae4yjnxly0dny0hky6yhnafukzjsyrsqhk

All opinions expressed within these pages are sent in by members of the public or by our staff in their spare time, and as such do not represent any opinion held by sircles.net Ltd or their partners.


sirclesadmin
a year ago
This is usually because you are missing some of the IIS components installable from server manager - try installing IIS scripts and tools and the management service and digest authentication. There is a reference in your site to an IIS component that is not installed.
sirclesadmin
a year ago
You may also need to update the link to the sql db file if there is one on the site or copy over the old web.config file too.