Solution Analysis problem

Hi,

I have a problem with Agent Smith plugin and R# Solution Analysis. If I set
inspection severity level to 'error' of an Agent Smith inspection, I see
these errors in 'Errors in Solution' windows. However if you click on any of
them solution analysis restarts from scratch, which is very annoying.
Am I doing something wrong or is it R# defect?

I'm attaching log. Please note the last line which says that cache is
corrupt. And it is strange that it can't find AgentSmith assembly because it
is loaded and working.

Thanks.




11:51:23 AM.108: Thread:7: EXCEPTION: Could not load file or assembly
'AgentSmith' or one of its dependencies. The system cannot find the file
specified.
System.IO.FileNotFoundException: Could not load file or assembly
'AgentSmith' or one of its dependencies. The system cannot find the file
specified.
File name: 'AgentSmith'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&
stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at
JetBrains.ReSharper.Daemon.SolutionAnalysis.HighlightingResult.ReadFrom(BinaryReader
reader, IProjectFileWrapper file) in
c:\Agent\work\e9a2fff71e84fb33\src\SolutionAnalysis\src\HighlightingResult.cs:line
192
at
JetBrains.ReSharper.Daemon.SolutionAnalysis.ExternalizationManager.ReadData(BinaryReader
reader, IProjectFileWrapper file) in
c:\Agent\work\e9a2fff71e84fb33\src\SolutionAnalysis\src\ExternalizationManager.cs:line
178
at
JetBrains.ReSharper.Psi.Util.Caches.AbstractPersistentCache`2.MyRecordsStorage.ReadData(BinaryReader
reader, TKey key) in
c:\Agent\work\e9a2fff71e84fb33\src\Psi\src\util\caches\AbstractPersistentCache.cs:line
302
at
JetBrains.ReSharper.Psi.Util.Caches.RecordsStorage`2.FetchDataForKey(TKey
key, TData& data) in
c:\Agent\work\e9a2fff71e84fb33\src\Psi\src\util\caches\RecordsStorage.cs:line
204

=== Pre-bind state information ===
LOG: User = KIEV\sergeyz
LOG: DisplayName = AgentSmith
(Partial)
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio
9.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : JetBrains.ReSharper.SolutionAnalysis, Version=4.0.816.4,
Culture=neutral, PublicKeyToken=1010a0d8d6380325.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Microsoft Visual
Studio 9.0\Common7\IDE\devenv.exe.Config
LOG: Using machine configuration file from
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/AgentSmith.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/AgentSmith/AgentSmith.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith/AgentSmith.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith/AgentSmith.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/AgentSmith.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/AgentSmith/AgentSmith.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith/AgentSmith.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Microsoft
Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith/AgentSmith.EXE.


11:51:23 AM.233: Thread:7: SolutionAnalysisManager: Cache is corrupt,
rebuilding


2 comments
Comment actions Permalink

Hello Sergey,

It looks like it is trying to load assembly in Load context, and cannot find
assembly by its name. When your plugin is loaded, it is loaded using LoadFrom
context. You can install AssemblyResolver:

myAssemblyResolver = AssemblyResolver.FromAssembly(Assembly.GetExecutingAssembly());
myAssemblyResolver.Install(AppDomain.CurrentDomain); // on component init

myAssemblyResolver.Dispose(); // on component dispose

However, it is certainly problem in plugin system, which we are going to
address in future version.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


SZ> Hi,
SZ>
SZ> I have a problem with Agent Smith plugin and R# Solution Analysis.
SZ> If I set
SZ> inspection severity level to 'error' of an Agent Smith inspection, I
SZ> see
SZ> these errors in 'Errors in Solution' windows. However if you click
SZ> on any of
SZ> them solution analysis restarts from scratch, which is very
SZ> annoying.
SZ> Am I doing something wrong or is it R# defect?
SZ> I'm attaching log. Please note the last line which says that cache
SZ> is corrupt. And it is strange that it can't find AgentSmith assembly
SZ> because it is loaded and working.
SZ>
SZ> Thanks.
SZ>
SZ> 11:51:23 AM.108: Thread:7: EXCEPTION: Could not load file or
SZ> assembly
SZ> 'AgentSmith' or one of its dependencies. The system cannot find the
SZ> file
SZ> specified.
SZ> System.IO.FileNotFoundException: Could not load file or assembly
SZ> 'AgentSmith' or one of its dependencies. The system cannot find the
SZ> file
SZ> specified.
SZ> File name: 'AgentSmith'
SZ> at System.Reflection.Assembly._nLoad(AssemblyName fileName,
SZ> String
SZ> codeBase, Evidence assemblySecurity, Assembly locationHint,
SZ> StackCrawlMark&
SZ> stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
SZ> at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
SZ> codeBase, Evidence assemblySecurity, Assembly locationHint,
SZ> StackCrawlMark&
SZ> stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
SZ> at System.Reflection.Assembly.InternalLoad(AssemblyName
SZ> assemblyRef,
SZ> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
SZ> forIntrospection)
SZ> at System.Reflection.Assembly.InternalLoad(String assemblyString,
SZ> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
SZ> forIntrospection)
SZ> at System.Reflection.Assembly.Load(String assemblyString)
SZ> at
SZ> JetBrains.ReSharper.Daemon.SolutionAnalysis.HighlightingResult.ReadF
SZ> rom(BinaryReader
SZ> reader, IProjectFileWrapper file) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\SolutionAnalysis\src\Highlighting
SZ> Result.cs:line
SZ> 192
SZ> at
SZ> JetBrains.ReSharper.Daemon.SolutionAnalysis.ExternalizationManager.R
SZ> eadData(BinaryReader
SZ> reader, IProjectFileWrapper file) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\SolutionAnalysis\src\Externalizat
SZ> ionManager.cs:line
SZ> 178
SZ> at
SZ> JetBrains.ReSharper.Psi.Util.Caches.AbstractPersistentCache`2.MyReco
SZ> rdsStorage.ReadData(BinaryReader
SZ> reader, TKey key) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\Psi\src\util\caches\AbstractPersi
SZ> stentCache.cs:line
SZ> 302
SZ> at
SZ> JetBrains.ReSharper.Psi.Util.Caches.RecordsStorage`2.FetchDataForKey
SZ> (TKey
SZ> key, TData& data) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\Psi\src\util\caches\RecordsStorag
SZ> e.cs:line 204
SZ>
SZ> === Pre-bind state information ===
SZ> LOG: User = KIEV\sergeyz
SZ> LOG: DisplayName = AgentSmith
SZ> (Partial)
SZ> LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio
SZ> 9.0/Common7/IDE/
SZ> LOG: Initial PrivatePath = NULL
SZ> Calling assembly : JetBrains.ReSharper.SolutionAnalysis,
SZ> Version=4.0.816.4,
SZ> Culture=neutral, PublicKeyToken=1010a0d8d6380325.
SZ> ===
SZ> LOG: This bind starts in default load context.
SZ> LOG: Using application configuration file: C:\Program
SZ> Files\Microsoft Visual
SZ> Studio 9.0\Common7\IDE\devenv.exe.Config
SZ> LOG: Using machine configuration file from
SZ> c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
SZ> LOG: Policy not being applied to reference at this time (private,
SZ> custom,
SZ> partial, or location-based assembly bind).
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PublicAssemblies/AgentSmith/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PrivateAssemblies/AgentSmith/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PublicAssemblies/AgentSmith/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PrivateAssemblies/AgentSmith/AgentSmith.EXE.
SZ> 11:51:23 AM.233: Thread:7: SolutionAnalysisManager: Cache is
SZ> corrupt, rebuilding
SZ>


0
Comment actions Permalink

Thanks, this works.

"Ilya Ryzhenkov" <orangy@jetbrains.com> wrote in message
news:76a2bd0b15acec8caa36066811fda@news.intellij.net...

Hello Sergey,

>

It looks like it is trying to load assembly in Load context, and cannot
find assembly by its name. When your plugin is loaded, it is loaded using
LoadFrom context. You can install AssemblyResolver:

>

myAssemblyResolver =
AssemblyResolver.FromAssembly(Assembly.GetExecutingAssembly());
myAssemblyResolver.Install(AppDomain.CurrentDomain); // on component init

>

myAssemblyResolver.Dispose(); // on component dispose

>

However, it is certainly problem in plugin system, which we are going to
address in future version.

>

Sincerely,
Ilya Ryzhenkov

>

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>

SZ> Hi,
SZ> SZ> I have a problem with Agent Smith plugin and R# Solution Analysis.
SZ> If I set
SZ> inspection severity level to 'error' of an Agent Smith inspection, I
SZ> see
SZ> these errors in 'Errors in Solution' windows. However if you click
SZ> on any of
SZ> them solution analysis restarts from scratch, which is very
SZ> annoying.
SZ> Am I doing something wrong or is it R# defect?
SZ> I'm attaching log. Please note the last line which says that cache
SZ> is corrupt. And it is strange that it can't find AgentSmith assembly
SZ> because it is loaded and working.
SZ> SZ> Thanks.
SZ> SZ> 11:51:23 AM.108: Thread:7: EXCEPTION: Could not load file or
SZ> assembly
SZ> 'AgentSmith' or one of its dependencies. The system cannot find the
SZ> file
SZ> specified.
SZ> System.IO.FileNotFoundException: Could not load file or assembly
SZ> 'AgentSmith' or one of its dependencies. The system cannot find the
SZ> file
SZ> specified.
SZ> File name: 'AgentSmith'
SZ> at System.Reflection.Assembly._nLoad(AssemblyName fileName,
SZ> String
SZ> codeBase, Evidence assemblySecurity, Assembly locationHint,
SZ> StackCrawlMark&
SZ> stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
SZ> at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
SZ> codeBase, Evidence assemblySecurity, Assembly locationHint,
SZ> StackCrawlMark&
SZ> stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
SZ> at System.Reflection.Assembly.InternalLoad(AssemblyName
SZ> assemblyRef,
SZ> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
SZ> forIntrospection)
SZ> at System.Reflection.Assembly.InternalLoad(String assemblyString,
SZ> Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
SZ> forIntrospection)
SZ> at System.Reflection.Assembly.Load(String assemblyString)
SZ> at
SZ> JetBrains.ReSharper.Daemon.SolutionAnalysis.HighlightingResult.ReadF
SZ> rom(BinaryReader
SZ> reader, IProjectFileWrapper file) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\SolutionAnalysis\src\Highlighting
SZ> Result.cs:line
SZ> 192
SZ> at
SZ> JetBrains.ReSharper.Daemon.SolutionAnalysis.ExternalizationManager.R
SZ> eadData(BinaryReader
SZ> reader, IProjectFileWrapper file) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\SolutionAnalysis\src\Externalizat
SZ> ionManager.cs:line
SZ> 178
SZ> at
SZ> JetBrains.ReSharper.Psi.Util.Caches.AbstractPersistentCache`2.MyReco
SZ> rdsStorage.ReadData(BinaryReader
SZ> reader, TKey key) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\Psi\src\util\caches\AbstractPersi
SZ> stentCache.cs:line
SZ> 302
SZ> at
SZ> JetBrains.ReSharper.Psi.Util.Caches.RecordsStorage`2.FetchDataForKey
SZ> (TKey
SZ> key, TData& data) in
SZ> c:\Agent\work\e9a2fff71e84fb33\src\Psi\src\util\caches\RecordsStorag
SZ> e.cs:line 204
SZ> SZ> === Pre-bind state information ===
SZ> LOG: User = KIEV\sergeyz
SZ> LOG: DisplayName = AgentSmith
SZ> (Partial)
SZ> LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio
SZ> 9.0/Common7/IDE/
SZ> LOG: Initial PrivatePath = NULL
SZ> Calling assembly : JetBrains.ReSharper.SolutionAnalysis,
SZ> Version=4.0.816.4,
SZ> Culture=neutral, PublicKeyToken=1010a0d8d6380325.
SZ> ===
SZ> LOG: This bind starts in default load context.
SZ> LOG: Using application configuration file: C:\Program
SZ> Files\Microsoft Visual
SZ> Studio 9.0\Common7\IDE\devenv.exe.Config
SZ> LOG: Using machine configuration file from
SZ> c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
SZ> LOG: Policy not being applied to reference at this time (private,
SZ> custom,
SZ> partial, or location-based assembly bind).
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PublicAssemblies/AgentSmith/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PrivateAssemblies/AgentSmith/AgentSmith.DLL.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/AgentSmith/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PublicAssemblies/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PublicAssemblies/AgentSmith/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio 9.0/Common7/IDE/PrivateAssemblies/AgentSmith.EXE.
SZ> LOG: Attempting download of new URL file:///C:/Program
SZ> Files/Microsoft
SZ> Visual Studio
SZ> 9.0/Common7/IDE/PrivateAssemblies/AgentSmith/AgentSmith.EXE.
SZ> 11:51:23 AM.233: Thread:7: SolutionAnalysisManager: Cache is
SZ> corrupt, rebuilding
SZ>



0

Please sign in to leave a comment.