Skip to content

EEFileLoadException when executing Services.AddMvc after upgrading from NET5.0 to NET6.0 #38469

Closed
@claudiolsmonteiro

Description

@claudiolsmonteiro

Describe the bug

After the release of NET6.0, my team decided it was a good idea to upgrade our API and Portal to NET6.0.
We changed every project's TargetFramework to 'net6.0' and upgraded every Nuget to their latest version. We have also changed a couple of methods related to now obsolete references (i.e WebClient -> HttpClient).
Our API started working right away but our Portal started throwing the exceptions written below.
We thought it could be a problem related to the old Hosting Model, but even after changing to the new one the exceptions are the same.

Piece of Code being executed:

builder.Services.AddMvc(option => option.EnableEndpointRouting = false)
              .AddControllersAsServices()
              .AddTagHelpersAsServices()
              .AddViewComponentsAsServices()
              .AddNewtonsoftJson(options =>
              {
                  options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
                  options.SerializerSettings.ContractResolver = new DefaultContractResolver();
              });

Exceptions

Exception thrown at 0x00007FFB89384F99 in iisexpress.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00000068F7D7D310.

Exception thrown at 0x00007FFB89384F99 in iisexpress.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.

Exception thrown at 0x00007FFB89384F99 in iisexpress.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00000068F7D7D310.

Exception thrown at 0x00007FFB89384F99 in iisexpress.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.

Exception thrown at 0x00007FFB89384F99 in iisexpress.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00000068F7D7D310.




System.IO.FileNotFoundException: 'Could not load file or assembly 'xxxxx.Client.Portal.Views, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'

iisexpress exception

image

Further technical details

  • ASP.NET Core version: NET6.0
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version: Visual Studio 2022 Version 17.0.1
dotnet --info Output
dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19042
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100\

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  2.1.519 [C:\Program Files\dotnet\sdk]
  5.0.202 [C:\Program Files\dotnet\sdk]
  5.0.401 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesfeature-mvc-razor-viewsFeatures related to the Razor view engine for Razor pages and MVC views

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions