Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Roslyn CustomWorkSpace not to cry for Visual Basic?

Tags:

c#

roslyn

I have a simple Roslyn code line as follows:

var workspace = new CustomWorkspace();

This line throws (and handles internally) the exception like:

"Could not load file or assembly 'Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

Please note the exception is only visible if you run the code in debugger, and configured the VS to show not only the unhandled exception.

I would not like to use Visual Basic features at all. I've reviewed the Workspace constructor overloads and the most promising one is what accepts a FeauterPack, but unfortunately the

 public class CSharpWorkspaceFeatures : FeaturePack

is not exist currently (and also completely commented out in the current Roslyn source)

Did I missed something?

Thanks in advance

E D I T: For @SLaks: (I am not running with Roslyn source, just using the NuGet packages. So this is all the exception info I have:

System.IO.FileNotFoundException occurred
  HResult=-2147024894
  Message=Could not load file or assembly 'Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
  Source=mscorlib
  FileName=Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  FusionLog==== Pre-bind state information ===
LOG: DisplayName = Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///D:/2014Develop.Core.Tests
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.CodeAnalysis.Workspaces, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\2014Develop\Core.Tests\Core.Tests.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///D:/2014Develop.Core.Tests/Microsoft.CodeAnalysis.VisualBasic.Workspaces.DLL.
LOG: Attempting download of new URL file:///D:/2014Develop.Core.Tests/Microsoft.CodeAnalysis.VisualBasic.Workspaces/Microsoft.CodeAnalysis.VisualBasic.Workspaces.DLL.
LOG: Attempting download of new URL file:///D:/2014Develop.Core.Tests/Microsoft.CodeAnalysis.VisualBasic.Workspaces.EXE.
LOG: Attempting download of new URL file:///D:/2014Develop.Core.Tests/Microsoft.CodeAnalysis.VisualBasic.Workspaces/Microsoft.CodeAnalysis.VisualBasic.Workspaces.EXE.

  StackTrace:
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
  InnerException: 

Stack trace from the Call Stack window:

mscorlib.dll!System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity, System.Reflection.RuntimeAssembly reqAssembly, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool throwOnFileNotFound, bool forIntrospection, bool suppressSecurityChecks) + 0xd2 bytes   
mscorlib.dll!System.Reflection.RuntimeAssembly.InternalLoad(string assemblyString, System.Security.Policy.Evidence assemblySecurity, ref System.Threading.StackCrawlMark stackMark, System.IntPtr pPrivHostBinder, bool forIntrospection) + 0xf2 bytes  
mscorlib.dll!System.Reflection.RuntimeAssembly.InternalLoad(string assemblyString, System.Security.Policy.Evidence assemblySecurity, ref System.Threading.StackCrawlMark stackMark, bool forIntrospection) + 0x11 bytes 
mscorlib.dll!System.Reflection.Assembly.Load(string assemblyString) + 0x23 bytes    
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.WellKnownFeatures.LoadAssembly(System.Collections.Generic.List<System.Reflection.Assembly> assemblies = Count = 2, string assemblyName = "Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") + 0x3f bytes  
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.WellKnownFeatures.ComputePack() + 0x2a4 bytes  
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.WellKnownFeatures.Features.get() + 0x3f bytes  
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.CustomWorkspace.CustomWorkspace(string workspaceKind = "Host") + 0x32 bytes    
Microsoft.CodeAnalysis.Workspaces.dll!Microsoft.CodeAnalysis.CustomWorkspace.CustomWorkspace() + 0x35 bytes 
SolutionValidator.Core.dll!SolutionValidator.CodeInspection.Refactoring.TreeRefactorRule<SolutionValidator.CodeInspection.Refactoring.RenamePrivateFieldsRewriter>.TreeRefactorRule(SolutionValidator.Configuration.IncludeExcludeCollection sourceFileFilters = null, SolutionValidator.FolderStructure.IFileSystemHelper fileSystemHelper = {Castle.Proxies.IFileSystemHelperProxy}, string fileNamePattern = "*.cs", bool isBackupEnabled = false) Line 36 + 0x21 bytes  C#
SolutionValidator.Core.dll!SolutionValidator.CodeInspection.Refactoring.RenamePrivateFieldsTreeRefactorRule.RenamePrivateFieldsTreeRefactorRule(string find = "^([a-zA-Z][a-zA-Z0-9_]*$)", string replace = "_$1", SolutionValidator.Configuration.IncludeExcludeCollection sourceFileFilters = null, SolutionValidator.FolderStructure.IFileSystemHelper fileSystemHelper = {Castle.Proxies.IFileSystemHelperProxy}, string fileNamePattern = "*.cs", bool isBackupEnabled = false) Line 32 + 0x2c bytes   C#
SolutionValidator.Core.Tests.dll!SolutionValidator.Tests.Validator.CodeInspection.RenamePrivateFieldsRefactorRuleTest.TestRenamePrivateFieldsRefactorRuleTest(string dummy = "Current scenarios", string inputSource = "\r\n\t\tclass C\r\n\t\t{\r\n\t\t\tprivate int aaa, bbb = 1;\r\n\t\t\tprivate int xxx;\r\n\t\t\tprivate int yyy;\r\n\r\n\t\t\tpublic int Xxx\r\n\t\t\t{\r\n\t\t\t\tget { return xxx; }\r\n\t\t\t\tset { xxx = value; }\r\n\t\t\t}\r\n\r\n\t\t\tprivate void M()\r\n\t\t\t{\r\n\t\t\t\tvar local = 10;\r\n\t\t\t\tConsole.WriteLine(\"Hello, World! {0} {1}\", yyy, local);\r\n\t\t\t\txxx = 3;\r\n\t\t\t\txxx = 4;\r\n\t\t\t\txxx = xxx;\r\n\t\t\t\tvar any = xxx.ToString();\r\n\t\t\t\tAnyMethod(xxx.ToString(), xxx.ToString(), xxx, xxx + 1);\r\n\t\t\t}\r\n\t\t}", string outputSource = "\r\n\t\tclass C\r\n\t\t{\r\n\t\t\tprivate int _aaa,_bbb = 1;\r\n\t\t\tprivate int _xxx;\r\n\t\t\tprivate int _yyy;\r\n\r\n\t\t\tpublic int Xxx\r\n\t\t\t{\r\n\t\t\t\tget { return _xxx; }\r\n\t\t\t\tset { _xxx = value; }\r\n\t\t\t}\r\n\r\n\t\t\tprivate void M()\r\n\t\t\t{\r\n\t\t\t\tvar local = 10;\r\n\t\t\t\tConsole.WriteLine(\"Hello, World! {0} {1}\", _yyy, local);\r\n\t\t\t\t_xxx = 3;\r\n\t\t\t\t_xxx = 4;\r\n\t\t\t\t_xxx = _xxx;\r\n\t\t\t\tvar any = _xxx.ToString();\r\n\t\t\t\tAnyMethod(_xxx.ToString(), _xxx.ToString(), _xxx, _xxx + 1);\r\n\t\t\t}\r\n\t\t}") Line 112 + 0x152 bytes  C#
[Native to Managed Transition]  
nunit.core.dll!NUnit.Core.Reflect.InvokeMethod(System.Reflection.MethodInfo method = {System.Reflection.RuntimeMethodInfo}, object fixture = {SolutionValidator.Tests.Validator.CodeInspection.RenamePrivateFieldsRefactorRuleTest}, object[] args = {object[3]}) + 0x7f bytes  
nunit.core.dll!NUnit.Core.TestMethod.RunTestMethod() + 0xa9 bytes   
nunit.core.dll!NUnit.Core.TestMethod.RunTestCase(NUnit.Core.TestResult testResult = {NUnit.Core.TestResult}) + 0x58 bytes   
nunit.core.dll!NUnit.Core.TestMethod.RunTest() + 0xdf bytes 
nunit.core.dll!NUnit.Core.NUnitTestMethod.RunTest() + 0x3b bytes    
nunit.core.dll!NUnit.Core.TestMethod.RunRepeatedTest() + 0x14b bytes    
nunit.core.dll!NUnit.Core.TestMethod.RunTestInContext() + 0x81d bytes   
nunit.core.dll!NUnit.Core.TestMethod.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x19a bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.ParameterizedMethodSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x1fb bytes  
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.TestFixture.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0xc5 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.TestSuite.RunAllTests(NUnit.Core.TestResult suiteResult = {NUnit.Core.TestResult}, NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x48d bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuite(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x6f3 bytes    
nunit.core.dll!NUnit.Core.TestSuite.RunSuiteInContext(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x8e bytes    
nunit.core.dll!NUnit.Core.TestSuite.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x11d bytes 
nunit.core.dll!NUnit.Core.SimpleTestRunner.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}, bool tracing = false, NUnit.Core.LoggingThreshold logLevel = Off) + 0x183 bytes    
JetBrains.ReSharper.UnitTestRunner.nUnit.dll!JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestRunner.Run(NUnit.Core.EventListener listener = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitListener}, NUnit.Core.ITestFilter filter = {JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTestFilter}) + 0x90 bytes    
JetBrains.ReSharper.UnitTestRunner.nUnit.dll!JetBrains.ReSharper.UnitTestRunner.nUnit.BuiltInNUnitRunner.RunTests(JetBrains.ReSharper.TaskRunnerFramework.IRemoteTaskServer server = {System.Runtime.Remoting.Proxies.__TransparentProxy}, System.Collections.Generic.Dictionary<string,JetBrains.ReSharper.TaskRunnerFramework.RemoteTask> tests = Count = 3, System.Collections.Generic.Dictionary<string,JetBrains.ReSharper.TaskRunnerFramework.RemoteTask> fixtures = Count = 1, System.Collections.Generic.List<string> explicitly = Count = 1, bool useAddins = false, System.Collections.Generic.List<string> assemblies = Count = 1) + 0x9f2 bytes 
[Native to Managed Transition]  
[Managed to Native Transition]  
mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg) + 0x405 bytes    
mscorlib.dll!System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0xc8 bytes    
mscorlib.dll!System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x16c bytes  
mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(object[] args) + 0xce bytes    
[Native to Managed Transition]  
[Managed to Native Transition]  
mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg = {System.Runtime.Remoting.Messaging.MethodCall}) + 0x113 bytes  
mscorlib.dll!System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(System.Runtime.Remoting.Messaging.IMessage msg = {System.Runtime.Remoting.Messaging.MethodCall}) + 0x158 bytes    
mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(byte[] reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage smuggledMcm, out System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) + 0xaa bytes 
mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(object[] args = {object[3]}) + 0x92 bytes 
[Appdomain Transition]  
mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatch(byte[] reqStmBuff, System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage smuggledMcm, out System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage smuggledMrm) + 0xa0 bytes   
mscorlib.dll!System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg = {System.Runtime.Remoting.Messaging.Message}) + 0x15d bytes  
mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.CallProcessMessage(System.Runtime.Remoting.Messaging.IMessageSink ms, System.Runtime.Remoting.Messaging.IMessage reqMsg, System.Runtime.Remoting.Contexts.ArrayWithSize proxySinks, System.Threading.Thread currentThread, System.Runtime.Remoting.Contexts.Context currentContext, bool bSkippingContextChain) + 0x8c bytes 
mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.InternalInvoke(System.Runtime.Remoting.Messaging.IMethodCallMessage reqMcmMsg, bool useDispatchMessage, int callType) + 0x22c bytes  
mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref System.Runtime.Remoting.Proxies.MessageData msgData, int type) + 0x1f4 bytes   
JetBrains.ReSharper.UnitTestRunner.nUnit.dll!JetBrains.ReSharper.UnitTestRunner.nUnit.NUnitTaskRunner.ExecuteRecursive(JetBrains.ReSharper.TaskRunnerFramework.TaskExecutionNode node = {JetBrains.ReSharper.TaskRunnerFramework.TaskExecutionNode}) + 0xfc0 bytes  
JetBrains.ReSharper.TaskRunnerFramework.dll!JetBrains.ReSharper.TaskRunnerFramework.StartupTaskRunnerHost.Execute(JetBrains.ReSharper.TaskRunnerFramework.TaskExecutionNode node = {JetBrains.ReSharper.TaskRunnerFramework.TaskExecutionNode}) + 0x1f9 bytes   
JetBrains.ReSharper.TaskRunnerFramework.dll!JetBrains.ReSharper.TaskRunnerFramework.StartupTaskRunnerHost.ExecuteNodes(System.Collections.Generic.IEnumerable<JetBrains.ReSharper.TaskRunnerFramework.TaskExecutionNode> nodes = Count = 1) + 0xa4 bytes    
JetBrains.ReSharper.TaskRunnerFramework.dll!JetBrains.ReSharper.TaskRunnerFramework.TasksPacketHandler.ThreadProc(JetBrains.ReSharper.TaskRunnerFramework.TaskRunnerProxy proxy = {JetBrains.ReSharper.TaskRunnerFramework.TaskRunnerProxy}, System.Collections.Generic.IEnumerable<JetBrains.ReSharper.TaskRunnerFramework.RemoteTaskPacket> packets = Count = 1, JetBrains.ReSharper.TaskRunnerFramework.AssemblyLoader loader = {JetBrains.ReSharper.TaskRunnerFramework.AssemblyLoader}) + 0x139 bytes  
JetBrains.ReSharper.TaskRunnerFramework.dll!JetBrains.ReSharper.TaskRunnerFramework.TasksPacketHandler.Accept.AnonymousMethod__1() + 0x4b bytes 
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x285 bytes 
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x9 bytes   
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x57 bytes    
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x51 bytes   
[Native to Managed Transition]  
like image 260
g.pickardou Avatar asked Mar 20 '23 15:03

g.pickardou


1 Answers

In the current preview that was released during //build/ 2014, you'll want to do is something like:

var customWorkspace = new CustomWorkspace(new MefExportPack(catalog));

where the catalog is a MEF catalog. You can see some code to construct the catalog here.

Since that preview, we've renamed a bunch of the types. If you're from the future (welcome from me in the past!) and using a preview that contains that change try this instead:

var customWorkspace = new CustomWorkspace(MefHostServices.Create(assemblies));

where assemblies is a list of the assemblies you want us to include in the MEF composition. It'd be up to you to Assembly.Load the ones you care about, in this case Microsoft.CodeAnalysis.Workspaces.dll and Microsoft.CodeAnalysis.CSharp.Workspaces.dll. You may also need to include the Features DLL, depending upon what you're doing.

like image 191
Jason Malinowski Avatar answered May 06 '23 19:05

Jason Malinowski