Could not load file or assembly in VS2017 with IIS express

6

We have a ASP.NET project in the company that runs for 5/6 developers. All Visual Studio 2017 and debug on IIS Express, no crazy setting or anything to make it run.

1 colleague cannot get it to work, he always gets the following exception:

enter image description here

We had this problem a few months back, then out of frustration the PC was re-installed and the problem was gone. He didn't develop for a few weeks and today the problem appeared again.

I searched long and far but it's such a generic error I can't really figure this one out.

When I run the fusion log viewer I see the following result:

https://pastebin.com/aCVZn3EB

The operation failed.
Bind result: hr = 0x80131018. No description available.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Program Files\IIS Express\iisexpress.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/Users/User/Projects/project/project.UserSite/
LOG: Initial PrivatePath = C:\Users\User\Projects\project\project.UserSite\bin
LOG: Dynamic Base = C:\Users\User\AppData\Local\Temp\Temporary ASP.NET Files\vs\e0254dae
LOG: Cache Base = C:\Users\User\AppData\Local\Temp\Temporary ASP.NET Files\vs\e0254dae
LOG: AppName = 38c6ff11
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\User\Projects\project\project.UserSite\web.config
LOG: Using host configuration file: C:\Users\User\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Binding succeeds. Returns assembly from C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll.
LOG: Assembly is loaded in default load context.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80131018).

*** Assembly Binder Log Entry  (7/18/2017 @ 8:55:15 AM) ***
visual-studio
iis-express
asked on Stack Overflow Jul 7, 2017 by Roger Far • edited Jul 18, 2017 by Roger Far

4 Answers

2

Are you trying to load a .NET 4 assembly with an EXE that asked for a diferrent CLR version? That requires an app.exe.config file that forces CLR 4 to be used.

Also please check the he has the same version of .NET installed.

answered on Stack Overflow Jul 17, 2017 by Mihail Stancescu
1

1- Close Visual Studio

2- Delete all files from "C:\WINDOWS\Microsoft.NET\Framework......\Temporary ASP.NET"

3- Open VS

4- Rebuild then run

answered on Stack Overflow Jul 15, 2017 by Yazan.Ati
1

I have the same issue, its random. Just install missing package via Nuget for that project. Open Package Manager Console and type:

PM> Install-Package System.ServiceModel.Activities

and go on installing packages till there is no more error: then stop.

answered on Stack Overflow Jul 17, 2017 by one_mile_run
1

Turns out with the help of Fusion Log I found 1 file that was 0kb in size: C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll

I restored the file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.ServiceModel.Activities.dll and it worked again!

answered on Stack Overflow Jul 18, 2017 by Roger Far

User contributions licensed under CC BY-SA 3.0