2015-01-09 2 views
1

Мы используем TeamCity в качестве сервера CI и хотим активировать функцию кодирования (.Net). Если я настрою проверку кода, у меня появилось много ошибок от инспектора. То же самое, если я попытаюсь выполнить проверку кода с помощью инструментов командной строки для перестроек.Исключение ошибок командной строки Resharper

Мы имеем следующую структуру проекта/решения

/ 
- Solutions/ 
    - Solution1/ 
     - Solution1.sln 
     - BuildOutput/ 
    - Solution2/ 
     - Solution2.sln 
     - BuildOutput 
    ... 
- Projects/ 
    - Project1/ 
     ... 
    - Project2/ 
     ... 

Проекты выполнены с возможностью Allways построить в растворе BuildOutput каталога.

Если я выполнить проверку кода, как это из каталога решения:

C:\Tools\RSCL\inspectcode.exe "Solution1.sln" 

я получил следующий вывод с ошибками в командной строке:

JetBrains Inspect Code 9.0 Update 1 
Running in 64-bit mode, .NET runtime 4.0.30319.34014 under Microsoft Windows NT 6.2.9200.0 
C:\Tools\RSCL\inspectcode.exe : Paths relative to drive roots are not supported. Parametername: component Der tats„chliche Wert war \BuildOutput\Debug. 
In Zeile:1 Zeichen:1 
+ C:\Tools\RSCL\inspectcode.exe "Solution1.sln" 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (Paths relative ...ldOutput\Debug.:String) [], RemoteException 
    + FullyQualifiedErrorId : NativeCommandError 

--- EXCEPTION #1/2 [ArgumentOutOfRangeException] 
Message = "Paths relative to drive roots are not supported." 
ExceptionPath = Root.InnerException 
ClassName = System.ArgumentOutOfRangeException 
HResult = COR_E_ARGUMENTOUTOFRANGE=80131502 
Source = JetBrains.Platform.Util 
ParamName = component 
ActualValue = \BuildOutput\Debug 
StackTraceString = " 
    bei JetBrains.Util.FileSystemPath.Combine(String component) 
    bei JetBrains.ProjectModel.Impl.CachedProjectItemValue`2.GetValue() 
    bei JetBrains.ProjectModel.ProjectImpl.<.ctor>b__5(ProjectImpl element) 
    bei JetBrains.ProjectModel.ProjectImpl.GetOutputFilePath() 
    bei JetBrains.ProjectModel.Build.OutputAssemblies.UpdateOutputAssemblyMvid(IProject project) 
    bei JetBrains.ProjectModel.Build.OutputAssemblies.AfterProjectOpenedInternal(IProject project) 
    bei JetBrains.DataFlow.Viewable.<>c__DisplayClass1d`1.<View>b__1b(Lifetime valueLifetime, TValue value) 
    bei JetBrains.DataFlow.ViewableCollection`1.Add(TValue item) 
    bei JetBrains.DataFlow.Lifetime.AddBracket(Action FOpening, Action FClosing) 
    bei JetBrains.ProjectModel.ProjectManagerBase.OpenProjectInstance(Pair`2 projectInstanceWithLifetime) 
    bei JetBrains.ProjectModel.ProjectManagerBase.<>c__DisplayClass8.<EnqueueOpenProjectInstance>b__6() 
    bei JetBrains.Util.Logging.Logger.Catch(Action action) 
" 
--- Outer --- 
--- EXCEPTION #2/2 [LoggerException] 
Message = " 
    Paths relative to drive roots are not supported. 
    Parametername: component 
    Der tats„chliche Wert war \BuildOutput\Debug. 
" 
ExceptionPath = Root 
ClassName = JetBrains.Util.LoggerException 
InnerException = "Exception #1 at Root.InnerException" 
HResult = COR_E_APPLICATION=80131600 
StackTraceString = " 
    bei JetBrains.ProjectModel.Tasks.SolutionLoadTasksSchedulerBase.ExecuteOneTask(SolutionLoadTask task) 
    bei JetBrains.ProjectModel.Tasks.SolutionLoadTasksSchedulerBase.DispatchTasks(Boolean background) 
    bei JetBrains.ProjectModel.SolutionManagerBase.CreateSolutionInstance(SolutionElement solutionElement, SolutionInstance solutionInstance) 
    bei JetBrains.ProjectModel.MsBuild.Internal.MsBuildSolutionManager.<>c__DisplayClass4.<>c__DisplayClass6.<.ctor>b__1() 
    bei JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action) 
    bei JetBrains.Threading.ReentrancyGuard.ExecuteOrQueue(String name, Action action) 
    bei JetBrains.ProjectModel.MsBuild.Internal.MsBuildSolutionManager.<>c__DisplayClass4.<.ctor>b__0(Lifetime msBuildSolutionLifetime, MsBuildSolution msBuildSolution) 
    bei JetBrains.DataFlow.Lifetimes.Define(Lifetime lifetime, String id, Action`2 FAtomic, ILogger logger) 
    bei JetBrains.DataFlow.SequentialLifetimes.DefineNext(Action`2 FNext) 
    bei JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload) 
    bei JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) 
    bei JetBrains.DataFlow.Property`1.FireChange(TValue old, TValue new, Object cookie) 
    bei JetBrains.DataFlow.Property`1.SetValue(TValue value, Object cookie) 
    bei JetBrains.ProjectModel.MsBuild.MsBuildSolutionHost.OpenSolution(FileSystemPath location, IMsBuildSolutionUserProfile userProfile) 
    bei JetBrains.CommandLine.InspectCode.Unattended.InspectCodeProductMain.OpenSolution(FileSystemPath solutionFilePath, ILogger logger, MsBuildSolutionHost solutionHost, SolutionsManager solutionsManager, 
IInspectCodeSettings settings) 
    bei JetBrains.CommandLine.InspectCode.Unattended.InspectCodeProductMain.Main(IThreading invocator, IShellLocks shellLocks, ILogger logger, IInspectCodeSettings settings, MsBuildSolutionHost solutionHost, 
SolutionsManager solutionsManager, PlatformMana 
ger platformManager, ISdkManager sdkManager, IProductCommandLineArguments argumentsRaw, IssuesTypesWriter issuesTypesWriter) 
    bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
    bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
    bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
    bei JetBrains.Application.Environment.RunsPublicStaticIntMain.<>c__DisplayClass7.<.ctor>b__0() 
    bei JetBrains.Util.Logging.Logger.Catch(Action action) 
    bei JetBrains.Threading.JetDispatcher.Closure.Execute() 
    bei JetBrains.Threading.JetDispatcher.ProcessQueue() 
    bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    bei System.Windows.Threading.DispatcherOperation.InvokeImpl() 
    bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    bei System.Windows.Threading.DispatcherOperation.Invoke() 
    bei System.Windows.Threading.Dispatcher.ProcessQueue() 
    bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
    bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 
    bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
    bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
    bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
    bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 
    bei JetBrains.DataFlow.Lifetimes.Using(Action`1 ?) 
    bei JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv) 
    bei JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv) 
    bei JetBrains.Application.Environment.JetEnvironment.InternalRun(JetHostParametersCaller host, ComponentContainer containerEnv) 
    bei JetBrains.Application.Environment.JetEnvironment.CreateAndRun(Full hostparams) 
    bei JetBrains.CommandLine.InspectCode.InspectCodeProgram.Main(Assembly assembly, HostInfo hostInfo, String[] args) 
    bei JetBrains.CommandLine.InspectCode.InspectCodeProgram.Main(String[] args) 
" 
Paths relative to drive roots are not supported. Parametername: component Der tats„chliche Wert war \BuildOutput\Debug. 
--- EXCEPTION #1/2 [ArgumentOutOfRangeException] 

... 

Я не понимаю, что происходит неправильно. Решения все являются готовыми, а проверка кода из VS работает хорошо на тех же решениях.

+0

Эй, вы нашли решение этой проблемы? – KnowHoper

+0

№ Нет решения найдено. – WebDucer

+0

См. Ниже решение – KnowHoper

ответ

1

Я понял. Моя неудача, потому что мой .csproj не определил SolutionDir. Относительная ошибка пути - это красная селедка, если можно так выразиться.

Убедитесь, что это в csproj

<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> 
Смежные вопросы