我使用Inspect Code 9.1.3(JetBrains ReSharper命令行工具的最新版本)和SonarQube 4.3.3会遇到错误。
好的,我的服务器处于脱机状态,我无法改变它(企业政策)......
没有暗示这个......我的解决方案包含.NET 3.5和.NET 4.5 C#项目(我正在使用声纳插件“Visual Studio Projects的分析引导程序”)
如何配置SonarQube / sonar-runner / sonar-project以避免此错误?谢谢你的帮助!
以下是一些跟踪日志摘录:
14:12:23.940 INFO - --- EXCEPTION #1/2 [WebException]
14:12:23.975 INFO - Message = "The remote name could not be resolved: 'www.jetbrains.com'"
14:12:23.975 INFO - ExceptionPath = Root.InnerException
14:12:23.976 INFO - ClassName = System.Net.WebException
14:12:23.976 INFO - HResult = COR_E_INVALIDOPERATION=80131509
14:12:23.977 INFO - Source = System
14:12:23.978 INFO - StackTraceString = "
14:12:23.978 INFO - at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
14:12:23.978 INFO - at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
14:12:23.979 INFO - at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
14:12:23.979 INFO - "
14:12:23.979 INFO -
14:12:23.980 INFO - --- Outer ---
14:12:23.980 INFO -
14:12:23.980 INFO - --- EXCEPTION #2/2 [LoggerException]
14:12:23.981 INFO - Message = "The remote name could not be resolved: 'www.jetbrains.com'"
14:12:23.981 INFO - ExceptionPath = Root
14:12:23.981 INFO - ClassName = JetBrains.Util.LoggerException
14:12:23.981 INFO - InnerException = "Exception #1 at Root.InnerException"
14:12:23.982 INFO - HResult = COR_E_APPLICATION=80131600
14:12:23.983 INFO - StackTraceString = "
14:12:23.983 INFO - at System.Windows.Threading.DispatcherOperation.InvokeImpl()
14:12:23.983 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.983 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.984 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:23.984 INFO - at System.Windows.Threading.DispatcherOperation.Invoke()
14:12:23.984 INFO - at System.Windows.Threading.Dispatcher.ProcessQueue()
14:12:23.984 INFO - at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.986 INFO - at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.986 INFO - at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
14:12:23.986 INFO - at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
14:12:23.986 INFO - at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
14:12:23.986 INFO - at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
14:12:23.987 INFO - at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
14:12:23.987 INFO - at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
14:12:23.987 INFO - at JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
14:12:23.987 INFO - at JetBrains.Threading.JetDispatcher.InternalPumpMessagesOnce()
14:12:23.987 INFO - at JetBrains.CommandLine.InspectCode.Unattended.InspectCodeProductMain.Main(IThreading invocator, IComponentContainer container, IShellLocks shellLocks, ILogger logger, IInspectCodeSettings settings, IProductCommandLineArguments argumentsRaw)
14:12:23.987 INFO - at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
14:12:23.987 INFO - at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
14:12:23.988 INFO - at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
14:12:23.988 INFO - at JetBrains.Application.Environment.RunsPublicStaticIntMain.<>c__DisplayClass7.<.ctor>b__0()
14:12:23.988 INFO - at JetBrains.Util.Logging.Logger.Catch(Action action)
14:12:23.988 INFO - at JetBrains.Threading.JetDispatcher.Closure.Execute()
14:12:23.988 INFO - at JetBrains.Threading.JetDispatcher.ProcessQueue()
14:12:23.988 INFO - at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
14:12:23.988 INFO - at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
14:12:23.989 INFO - at System.Windows.Threading.DispatcherOperation.InvokeImpl()
14:12:23.989 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.989 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:23.989 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:23.989 INFO - at System.Windows.Threading.DispatcherOperation.Invoke()
14:12:23.989 INFO - at System.Windows.Threading.Dispatcher.ProcessQueue()
14:12:23.989 INFO - at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.990 INFO - at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
14:12:23.990 INFO - at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
14:12:23.990 INFO - at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
14:12:23.990 INFO - at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
14:12:23.990 INFO - at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
14:12:23.990 INFO - at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
14:12:23.990 INFO - at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
14:12:23.991 INFO - at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
14:12:23.991 INFO - at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
14:12:23.991 INFO - at JetBrains.DataFlow.Lifetimes.Using(Action`1 ?)
14:12:23.992 INFO - at JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv)
14:12:23.992 INFO - at JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv)
14:12:23.992 INFO - at JetBrains.Application.Environment.JetEnvironment.InternalRun(JetHostParametersCaller host, ComponentContainer containerEnv)
14:12:23.992 INFO - at JetBrains.Application.Environment.JetEnvironment.CreateAndRun(Full hostparams)
14:12:23.992 INFO - at JetBrains.CommandLine.InspectCode.InspectCodeProgram.Main(Assembly assembly, HostInfo hostInfo, String[] args)
14:12:23.993 INFO - at JetBrains.CommandLine.InspectCode.InspectCodeProgram.<Main>b__1(RunnerContext ctx)
14:12:23.993 INFO - "
...
14:12:46.683 INFO - --- EXCEPTION #1/2 [InvalidOperationException]
14:12:46.683 INFO - Message = "Unknown C# language level: Default"
14:12:46.683 INFO - ExceptionPath = Root.InnerException
14:12:46.683 INFO - ClassName = System.InvalidOperationException
14:12:46.684 INFO - HResult = COR_E_INVALIDOPERATION=80131509
14:12:46.684 INFO - Source = JetBrains.ReSharper.Psi.CSharp
14:12:46.684 INFO - StackTraceString = "
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.CSharp.CSharpExtensionMethods.GetCSharpVersion(CSharpLanguageLevel level)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.CSharp.Impl.Tree.AttributeStub.MyConstructorReference.Resolve(IResolveContext resolveContext)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve.Managed.ResolveContext.ResolveWithInfoCalculator(IManagedReferenceImpl reference, Object state, IResolveContext resolveContext)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.Impl.Resolve.Managed.CalculationProcess.Get[TKey,TParameter,TValue](CascadingCacheKey cacheKey, TKey key, TParameter param, IResolveContext resolveContext, Func`4 calculator)
14:12:46.685 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve.Managed.ResolveContext.ResolveWithInfo(IManagedReference reference)
14:12:46.685 INFO - at JetBrains.ReSharper.Daemon.CSharp.Stages.SmartResolverProcess.ScopeResolver.VisitElement(ITreeNode element)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.Resolve.Resolver.ProcessAfterInterior(ITreeNode element)
14:12:46.686 INFO - at JetBrains.ReSharper.Daemon.CSharp.Stages.SmartResolverProcess.ScopeResolver.ProcessAfterInterior(ITreeNode element)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.686 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.687 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.688 INFO - at JetBrains.ReSharper.Psi.RecursiveElementProcessorExtensions.ProcessDescendantForResolve(IRecursiveElementProcessor processor, ITreeNode descendant)
14:12:46.688 INFO - at JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendantsForResolve(IRecursiveElementProcessor processor)
14:12:46.688 INFO - at JetBrains.ReSharper.Psi.Resolve.Resolver.Process(ITreeNode topElement)
14:12:46.688 INFO - at JetBrains.Application.Threading.Tasks.TaskHost.<>c__DisplayClass11.<Create>b__e(Object state)
14:12:46.688 INFO - "
14:12:46.689 INFO -
14:12:46.689 INFO - --- Outer ---
14:12:46.689 INFO -
14:12:46.689 INFO - --- EXCEPTION #2/2 [LoggerException]
14:12:46.689 INFO - Message = "Unknown C# language level: Default"
14:12:46.689 INFO - ExceptionPath = Root
14:12:46.689 INFO - ClassName = JetBrains.Util.LoggerException
14:12:46.690 INFO - InnerException = "Exception #1 at Root.InnerException"
14:12:46.690 INFO - HResult = COR_E_APPLICATION=80131600
14:12:46.690 INFO - StackTraceString = "
14:12:46.690 INFO - at System.Threading.Tasks.Task.Execute()
14:12:46.691 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.691 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.691 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:46.691 INFO - at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
14:12:46.691 INFO - at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
14:12:46.692 INFO - at System.Threading.Tasks.TaskScheduler.TryRunInline(Task task, Boolean taskWasPreviouslyQueued, Object threadStatics)
14:12:46.692 INFO - at System.Threading.Tasks.Task.WrappedTryRunInline(TaskScheduler currentScheduler, Object currentSchedulerStatics)
14:12:46.692 INFO - at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
14:12:46.692 INFO - at JetBrains.Application.Threading.Tasks.TaskBarrier.DisposeUnmanagedResources()
14:12:46.692 INFO - at JetBrains.Util.SafeDisposable.DisposeInternal()
14:12:46.693 INFO - at JetBrains.ReSharper.Daemon.CSharp.Stages.SmartResolverProcess.Execute(Action`1 committer)
14:12:46.693 INFO - at JetBrains.ReSharper.Feature.Services.Daemon.DaemonProcessBase.<>c__DisplayClassc.<DoHighlighting>b__5(IDaemonStage stage)
14:12:46.693 INFO - at JetBrains.Application.Threading.Tasks.TaskBarrier.<>c__DisplayClassc.<>c__DisplayClasse.<EnqueueDependentJobs>b__a()
14:12:46.693 INFO - at JetBrains.Application.Threading.Tasks.TaskHost.<>c__DisplayClass11.<Create>b__e(Object state)
14:12:46.693 INFO - at System.Threading.Tasks.Task.Execute()
14:12:46.694 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.694 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.694 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:46.694 INFO - at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
14:12:46.695 INFO - at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
14:12:46.695 INFO - at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.ThreadPoolProc()
14:12:46.695 INFO - at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.695 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
14:12:46.695 INFO - at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
14:12:46.696 INFO - at System.Threading.ThreadHelper.ThreadStart()
14:12:46.696 INFO - "
答案 0 :(得分:1)
尝试安装JB InspectCode 9.2。至少&#34;未知C#语言级别:默认&#34;异常应该在那里修复https://youtrack.jetbrains.com/issue/RSRP-442801
答案 1 :(得分:0)
听起来你正面临JetBrains ReSharper命令行工具的问题 - 它与SonarQube集成无关。
尽管如此,我还想补充说明#34;分析引导程序对于Visual Studio项目&#34;插件已被弃用,并且已被&#34; MSBuild SonarQube Runner&#34;取代,后者本身与MSBuild集成。
您可以使用ReSharper命令行工具&amp;找到有关如何分析C#项目的示例。这里的MSBuild SonarQube Runner:http://docs.sonarqube.org/display/PLUG/ReSharper+Plugin