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:
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 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)
Please sign in to leave a comment.
Hello Sergey,
Could you please try openning the solution in Visual Studio with ReSharper installed? Will ReSharper show any error there?
Thanks!
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?
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!
The same exceptions after installing the latest version of Resharper. MSVS 2012.
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!
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?
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!
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.
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?