Could not load file or assembly System.Threading.Timer.dll

596 Views Asked by At

While trying to build a Visual Studio 2013 C# solution with MSBuild, the following error is displayed and the build is aborted.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268,9): e
rror MC1000: Unknown build error, 'Could not load file or assembly 'file:///C:\
Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
.2\Facades\System.Threading.Timer.dll' or one of its dependencies. The module w
as expected to contain an assembly manifest.'  [*.csproj]

I've tried updating and reinstalling .NET v4.5.2, but it hasn't helped.

What's strange is that renaming System.Threading.Timer.dll makes the project buildable, but then other parts of the solution complain that it's missing.

2

There are 2 best solutions below

5
laskdjf On

Your project file where the assemblies are referenced might be corrupted. Try this.

  1. Clear the \bin folder of your project

  2. Clear the temp folder in C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET Files

0
user2147163 On

Clear your bin directory and then Clean and Build the solution If you still get the same error then Go to your reference folder and remove the delete manually and add again it might not be compatible