1

Closed

Could not load file or assembly 'Microsoft.StyleCop, ...'

description

I'm getting the following Unhandled Exception from ReSharper when I open Visual Studio:
 
JetBrains.Util.LoggerException: Could not load file or assembly 'Microsoft.StyleCop, Version=4.3.0.8, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.StyleCop, Version=4.3.0.8, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.StyleCop, Version=4.3.0.8, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at StyleCop.For.ReSharper.StyleCopRunner.Execute(IProjectFile projectFile, String shadowFilePath)
at StyleCop.For.ReSharper.StyleCopStageProcess.Execute()
at JetBrains.ReSharper.Daemon.Impl.DaemonProcessBase.DoHighlighting(DaemonProcessKind kind) in c:\Agent\work\3f4db6fd459dabcd\src\Daemon\src\Impl\DaemonProcessBase.cs:line 321
 
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].
 
--- End of inner exception stack trace ---
 
at JetBrains.Util.Logger.LogException(Exception) in c:\Agent\work\3f4db6fd459dabcd\Platform\src\Util\src\Logger\Logger.cs:line 441 column 5
at JetBrains.ReSharper.Daemon.Impl.DaemonProcessBase.DoHighlighting(DaemonProcessKind) in c:\Agent\work\3f4db6fd459dabcd\src\Daemon\src\Impl\DaemonProcessBase.cs:line 329 column 19
at JetBrains.ReSharper.Daemon.Impl.VisibleDocumentDaemonProcess.DoHighlighting(Boolean) in c:\Agent\work\3f4db6fd459dabcd\src\Daemon\src\Impl\VisibleDocumentDaemonProcess.cs:line 188 column 9
at JetBrains.ReSharper.Daemon.Impl.<>c__DisplayClass1.<EnqueueHighlightingJob>b__0() in c:\Agent\work\3f4db6fd459dabcd\src\Daemon\src\Impl\VisibleDocumentDaemonProcess.cs:line 174 column 60
at JetBrains.ReSharper.Daemon.Impl.DaemonThread.ThreadProc() in c:\Agent\work\3f4db6fd459dabcd\src\Daemon\src\Impl\DaemonThread.cs:line 127 column 13
at System.Threading.ThreadHelper.ThreadStart_Context(Object)
at System.Threading.ExecutionContext.Run(ExecutionContext, ContextCallback, Object)
at System.Threading.ThreadHelper.ThreadStart()
 
I have a Microsoft.StyleCop.dll file with file version 4.3.0.8 located at C:\Program Files\MSBuild\Microsoft\StyleCop\v4.3 on my machine.
Closed Aug 18, 2010 at 8:41 PM by andyr
Latest version fixes this.

comments

wrote Oct 11, 2008 at 9:42 AM

Resolved with changeset 41474.

HowardvanRooijen wrote Nov 6, 2008 at 8:56 AM

** Closed by HowardvanRooijen 10/11/2008 2:42 AM

HowardvanRooijen wrote Nov 6, 2008 at 8:56 AM

dukesb11 wrote Nov 6, 2008 at 2:40 PM

When I try to install the new release, it says that I need to install StyleCop, even though it's already installed the MsBuild support. Do I have to install the Visual Studio integration?

HowardvanRooijen wrote Nov 6, 2008 at 5:28 PM

Have you tried using the Resharper Options menu > StyleCop panel to manually select the assembly?

dukesb11 wrote Nov 6, 2008 at 9:50 PM

I can't even get the new version installed to use that setting. I guess I'll install the VS integration, install the new version, set the assembly, then uninstall the VS integration again.

dukesb11 wrote Dec 8, 2008 at 2:37 PM

Using the new 0.0.14220 release, still getting a message that StyleCop isn't installed. Just moved to Vista 64-bit, so the MSBuild support is now installed at C:\Program Files (x86)\MSBuild\Microsoft\StyleCop\v4.3, assuming that's the issue.

HowardvanRooijen wrote Jul 26, 2010 at 1:33 PM

fixed and released

** Closed by HowardvanRooijen 11/6/2008 1:57 AM

dukesb11 wrote Jul 26, 2010 at 1:33 PM

When installing just the MSBuild Integration (not Visual Studio Integration), I still get an error that the assembly can't be found (with the new version for StyleCop 4.4). The file is C:\Program Files (x86)\MSBuild\Microsoft\StyleCop\v4.4\Microsoft.StyleCop.dll. Seems like the options page is gone for now, so I can't set the location manually, either...

HowardvanRooijen wrote Jul 26, 2010 at 8:11 PM

@dukesb11 - have a look at C:\Users\<LOGIN>\AppData\Roaming\JetBrains\ReSharper\v5.1\vs10.0\UserSettings.xml
You can add a node <StyleCopForReSharper><SpecifiedAssemblyPath>PATH TO ASSEMBLY</></> and try and reload