Hi;
I run your code successfully at my TFS. Everything is perfect.
I changed your code a little in my dll (Not in your wrapper dll). I uploaded to TFS. Run the task at agent. Powershell invokes dll without problem. Code's "StyleCopConsole" declaration line, it throws
"Could not load file or assembly 'StyleCop, Version=4.7.1000.0...." Exception.
We are using the same SytleCop dlls.
Have you ever got the same error? How did you solved it?
System.Management.Automation.MethodInvocationException: Exception calling "Scan" with "0" argument(s): "Could not load file or assembly 'StyleCop, Version=4.7.1000.0, Culture=neutral, PublicKeyToken=f904653c63bc2738' or one of its dependencies. The system cannot find the file specified." ---> System.IO.FileNotFoundException: Could not load file or assembly 'StyleCop, Version=4.7.1000.0, Culture=neutral, PublicKeyToken=f904653c63bc2738' or one of its dependencies. The system cannot find the file specified.
at StyleCopWrapper.Wrapper.Scan()
at CallSite.Target(Closure , CallSite , Object )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)