Resharper command line tools exceptions

Hello,

I am trying to use Resharper's inspectcode.exe tools for analyzing the code, but besides getting the report also get tons of exeptions in the log.
Could someone say how critical they are and can I trust to a report that was generated with these exceptions? May be some configuration changes should be made?

Exceptions looks like this:

InspectCode 8.2.1000.4527
Running in 64-bit mode, .NET runtime 4.0.30319.18063 under Microsoft Windows NT 6.1.7601 Service Pack 1
Internal error: Unsupported FrameworkVersion 4.2
Internal exception thrown: Unsupported FrameworkVersion 4.2

--- EXCEPTION #1/1 [LoggerException]
Message = "Unsupported FrameworkVersion 4.2"
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = "
  at JetBrains.ProjectModel.impl.SystemFrameworkLocationHelper.GetNetFrameworkDirectory(Version version)
     at JetBrains.ProjectModel.impl.FrameworkDetectionHelperBase.GetPlatformInfoFromFrameworkDir(FileSystemPath frameworkDir, PlatformID platformID, Func`2 getAssemblyFolders, Func`2 getRuntimeDir)
     at JetBrains.ProjectModel.impl.FrameworkDetectionHelperBase.<>c__DisplayClass8.<GetFrameworksFromReferenceAssembliesFolder>b__7(Lifetime lifetime)
     at JetBrains.DataFlow.Lifetimes.Using[TRetVal](Func`2 F)
     at JetBrains.ProjectModel.impl.FrameworkDetectionHelperBase.GetFrameworksFromReferenceAssembliesFolder(FileSystemPath path, Func`2 getAssemblyFolders, Func`2 getRuntimeDir, Func`2 addRuntimeFramework)


ERROR: Internal exception thrown: Can not update content of project 'PXXXX.Workflow'. Key already exists
ERROR:
ERROR: --- EXCEPTION #1/2 [ArgumentException]
ERROR: Message = "Key  already exists"
ERROR: ExceptionPath = Root.InnerException
ERROR: ClassName = System.ArgumentException
ERROR: HResult = COR_E_ARGUMENT=E_INVALIDARG=80070057
ERROR: Source = JetBrains.Platform.ReSharper.Util
ERROR: StackTraceString = "
ERROR:   at JetBrains.Util.DataStructures.CompactMapBase`4.Insert(TKey key, TValue value, Boolean addNew)
ERROR:      at JetBrains.ProjectModel.MsBuild.MsBuildSolution.InitProjectsIndexImpl(ICollection`1 projects, CompactMap`2& guidIndex, CompactMap`2& locationIndex)
ERROR:      at JetBrains.ProjectModel.MsBuild.MsBuildSolution.InitProjectsIndexImpl(ICollection`1 projects, CompactMap`2& guidIndex, CompactMap`2& locationIndex)
ERROR:      at JetBrains.ProjectModel.MsBuild.MsBuildSolution.GetProjectByGuid(Guid targetProjectGuid)
ERROR:      at JetBrains.ProjectModel.MsBuild.Extensions.ProjectReferencesBuilder.BuildProjectReferences(ProjectInstance projectInstance, IProjectProperties projectProperties, MsBuildProject msBuildProject, ISolution solution, BuildManager buildManager)



ERROR: Internal error: Asking for writer lock unexpected!
ERROR: Internal exception thrown: Asking for writer lock unexpected!
ERROR:
ERROR: --- EXCEPTION #1/1 [LoggerException]
ERROR: Message = "Asking for writer lock unexpected!"
ERROR: ExceptionPath = Root
ERROR: ClassName = JetBrains.Util.LoggerException
ERROR: HResult = COR_E_APPLICATION=80131600
ERROR: StackTraceString = "
ERROR:   at JetBrains.Application.ShellLocks.FireBeforeAcquiringWriteLock(BeforeAcquiringWriteLockEventArgs args)
ERROR:      at JetBrains.Application.ShellLocks.AcquireWriteLock()
ERROR:      at JetBrains.Application.IShellLocksEx.ExecuteWithWriteLock(IShellLocks th?s, Action F)
ERROR:      at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)
ERROR:      at JetBrains.Threading.ReentrancyGuard.<ExecutePendingActions>b__8(QueuedAction action)

9 comments
Comment actions Permalink

Hello Sergey,

  Could you please try openning the solution in Visual Studio with ReSharper installed? Will ReSharper show any error there?

Thanks!

0
Comment actions Permalink

Threotically, I can, but I have to install it. The plan was to use it on the build server without installer resharper into the visual studio.
Does it somehow connected?

0
Comment actions Permalink

Hello Sergey,

  Opening the solution using ReSharper may help us to understand the root of the issue.

  And of course, you do not need ReSharper on CI server to use Commad Line Tools.

Thanks!

0
Comment actions Permalink

The same exceptions after installing the latest version of Resharper. MSVS 2012.

0
Comment actions Permalink

Sergey,

  Do you use .NET Micro Framework 4.2 in your solution?

  We just try to understand why ReSharper/CLT gets "4.2" as a FrameworkVersion.

Thanks!

0
Comment actions Permalink

No, we don't. I even tried to find any references to 4.2 and didn't find anything. Binary search also was unsuccessful. Solution is executed only on the desktop OSs.
Could you recommend any way how to check that there are no 4.2 dependencies for sure?

0
Comment actions Permalink

So, it also may be releated to .NET Framework versions installed on the machine.

Could you please
- export the following registry branch HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP;
- create dump of folders' structure for the following folders in C:\Program Files (x86)\:
  1. Reference Assemblies
  2. Windows Kits
  3. MSBuild
  4. Microsoft SDKs

Then send all result files to alexander.kurakin (at) jetbrains.com

Thanks!

0
Comment actions Permalink

OK. After some investigations we figured out that EF installed some assembiles into 4.2 folder. I removed this folder from the Referenced Assembiles folder; however, the exceptions about the loggers, writers logs etc. are still here.

0
Comment actions Permalink

I also have the "Asking for writer lock unexpected. File changes:" exception. Which fails our build. Use CLI 2018.1.4. In Visual Studio, everything works as expected.

What can I do?

20:12:06 C:\Jenkins\Slave\workspace\job>"C:\Program Files\JetBrains.ReSharper.CommandLineTools.2018.1.4\inspectcode.x86.exe" .\project.sln --no-swea -o=.\resharper_check.xml --properties:QTDIR=C:\Qt\Qt5.11.1\5.11.1\msvc2017_64 
20:12:06 JetBrains Inspect Code 2018.1.4
20:12:06 Running in 32-bit mode, .NET runtime 4.0.30319.42000 under Microsoft Windows NT 6.2.9200.0
20:12:12 Disabled solution-wide analysis according to Inspect Code command line Setting.
20:12:21 Warning: Created resolver for C:\Jenkins\Slave\workspace\job\x64\Debug\app1.dll assembly cannot get its mvid. Check that the input assembly path is correct
20:12:21 Warning: Created resolver for C:\Jenkins\Slave\workspace\job\x64\Debug\app2.exe assembly cannot get its mvid. Check that the input assembly path is correct
20:12:21 Warning: Created resolver for C:\Jenkins\Slave\workspace\job\x64\Debug\app3.exe assembly cannot get its mvid. Check that the input assembly path is correct
20:12:21 Warning: Created resolver for C:\Jenkins\Slave\workspace\job\x64\Debug\app4.exe assembly cannot get its mvid. Check that the input assembly path is correct
20:12:33 Solution-wide analysis is DISABLED
20:12:34 Running inspections
20:12:34 
20:12:34 Inspecting <Components>\GeneratedFiles\moc_fileA.cpp
20:12:38 Inspecting <Components>\GeneratedFiles\moc_fileB.cpp
...
20:38:17
--- EXCEPTION #1/1 [LoggerException] 20:38:17 Message = "Asking for writer lock unexpected. File changes:" 20:38:17 ExceptionPath = Root 20:38:17 ClassName = JetBrains.Util.LoggerException 20:38:17 HResult = COR_E_APPLICATION=80131600 20:38:17 StackTraceString = " 20:38:17 bei JetBrains.CommandLine.InspectCode.Unattended.InspectCodeProductMain.<>c__DisplayClass2_0.<Main>b__4(Object sender, BeforeAcquiringWriteLockEventArgs args) 20:38:17 bei JetBrains.Application.Threading.ContentModelReadWriteLock.FireBeforeAcquiringWriteLock(BeforeAcquiringWriteLockEventArgs args) 20:38:17 bei JetBrains.Application.Threading.ContentModelReadWriteLock.AcquireWriteLock(CallerInfo callerInfo) 20:38:17 bei JetBrains.ReSharper.Resources.Shell.WriteLockCookie.Create(CallerInfo caller) 20:38:17 bei JetBrains.ReSharper.Psi.Cpp.Util.CppWriteLock..ctor() 20:38:17 bei JetBrains.ReSharper.Psi.Cpp.Caches.CppGeneratedFilesCache.SynchronizeDocumentAction.Synchronize() 20:38:17 bei JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action) 20:38:17 bei JetBrains.Threading.ReentrancyGuard.ExecutePendingActions() 20:38:17 bei JetBrains.Threading.JetDispatcher.Closure.Execute() 20:38:17 bei JetBrains.Util.Concurrency.WinJetDispatcher.ProcessQueue(Int32 nMinBucket) 20:38:17 bei JetBrains.Util.Concurrency.WinJetDispatcher.<>c__DisplayClass18_0.<BeginInvokeCore>b__0() 20:38:17 bei System.Windows.Threading.DispatcherOperation.InvokeDelegateCore() 20:38:17 bei System.Windows.Threading.DispatcherOperation.InvokeImpl() 20:38:17 bei System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 20:38:17 bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCa
...

I figured out, that deleting the '_ReSharper.Caches' helped.
2

Please sign in to leave a comment.