IIS 7.5 – Parser Error Message: Could not load file or assembly Microsoft.ReportViewer.WebForms

When deploying a new application to IIS 7.5 on Windows Server 2008 R2 (test server). I got the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 24: <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 25: <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
Line 26: <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 27: <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 28: <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

Source File: C:\inetpub\wwwroot\web.config Line: 26

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms...

I forgot to install Microsoft ReportViewer 2010 Redistributable.

It also can be installed from the following location:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\ReportViewer\ReportViewer.exe

Microsoft Report Viewer 2010 Redistributable Package Setup is easy 3 step process:

Microsoft Report Viewer 2010 Redistributable Package Setup
Microsoft Report Viewer 2010 Redistributable Package Setup 2
Microsoft Report Viewer 2010 Redistributable Package Setup Finished

VMware Guest OS: The trust relationship between this workstation and the primary domain failed

VMware Guest OS: The trust relationship between this workstation and the primary domain failed.

I received this errors two times on a row for two different computers.

I am not 100% sure, but from reading the web I came to conclusion that this error is encountered when:

  1. SID gets cloned when computer gets cloned using VMware. Not right after cloning, but at the random after some time.
  2. Guest OS gets reverted to some earlier snapshot.

In both cases leaving and joining Domain again fixes this issue.

P.S. Some time ago there was an utility called NewSID, but now it’s gone. NewSID has been retired and is no longer available for download. Please see Mark Russinovich’s blog post: NewSID Retirement and the Machine SID Duplication Myth.

How to delete all folders in current directory

How to delete all folders in current directory using command line (cmd.exe) or batch files?

How to delete all empty directories in current folder:
FOR /D %f IN (*.*) DO RD "%f"

How to delete all directories / folders in current directory / folder:
FOR /D %f IN (*.*) DO RD "%f" /S /Q

If you are using FOR in batch file, you must use double % signs.
FOR /D %%f IN (*.*) DO RD "%%f" /S /Q