when I try to run mspec test via ReSharper which executes this code:
new HttpServer();
I get the exception below. If I copy ReSharper dlls to the test folder (bin\Release) - everything works as expected. What would be the reason of the exception?
Thanks!
System.IO.FileNotFoundException: Could not load file or assembly 'JetBrains.ReSharper.Psi, Version=6.0.2202.688, Culture=neutral, PublicKeyToken=1010a0d8d6380325' or one of its dependencies. The system cannot find the file specified.
<div class="stacktrace">at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssemblyassembly,
ObjectHandleOnStackretTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at System.Web.Http.Dispatcher.HttpControllerTypeCacheUtil.FilterTypesInAssemblies(IBuildManagerbuildManager, Predicate`1predicate)
at System.Web.Http.Dispatcher.HttpControllerTypeCacheUtil.GetFilteredTypesFromAssemblies(StringcacheName, Predicate`1predicate, IBuildManagerbuildManager)
at System.Web.Http.Dispatcher.HttpControllerTypeCache.InitializeCache()
at System.Web.Http.Dispatcher.HttpControllerTypeCache..ctor(HttpConfigurationconfiguration)
at System.Web.Http.Dispatcher.DefaultHttpControllerFactory..ctor(HttpConfigurationconfiguration)
at System.Web.Http.Services.DefaultServiceResolver.<.ctor>b__0(HttpConfigurationconfig)
at System.Web.Http.Services.DefaultServiceResolver.GetService(Typet)
at System.Web.Http.Services.DependencyResolver.GetService(TypeserviceType)
at System.Web.Http.DependencyResolverExtensions.GetService(DependencyResolverresolver)
at System.Web.Http.DependencyResolverExtensions.GetServiceOrThrow(DependencyResolverresolver)
at System.Web.Http.DependencyResolverExtensions.GetHttpControllerFactory(DependencyResolverresolver)
at System.Web.Http.Dispatcher.HttpControllerDispatcher..ctor(HttpConfigurationconfiguration)
at System.Web.Http.HttpServer..ctor(HttpConfigurationconfiguration)
at System.Web.Http.HttpServer..ctor()
at Tests.Reporting.EndToEnd.get_today_daily_activity.<.ctor>b__0() in
get_today_daily_activity.cs: line 21</div> <div class="stacktrace"></div>
Not sure how ReSharper's test runner works but it looks like it's copying some binaries into your application's bin folder. Web API searches all bin assemblies for ApiController classes, and it looks like whatever got copied by ReSharper is unable to load
some other DLL. You should look at your test project and verify the purpose of the JetBrains.ReSharper.Psi assembly.
Vistor
Member
12 Points
9 Posts
Cannot create HttpServer from a test run by ReSharper
Mar 03, 2012 02:25 PM|LINK
Hello,
when I try to run mspec test via ReSharper which executes this code:
I get the exception below. If I copy ReSharper dlls to the test folder (bin\Release) - everything works as expected. What would be the reason of the exception?
Thanks!
System.IO.FileNotFoundException: Could not load file or assembly 'JetBrains.ReSharper.Psi, Version=6.0.2202.688, Culture=neutral, PublicKeyToken=1010a0d8d6380325' or one of its dependencies. The system cannot find the file specified.
<div class="stacktrace">at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)at System.Reflection.RuntimeAssembly.GetExportedTypes()
at System.Web.Http.Dispatcher.HttpControllerTypeCacheUtil.FilterTypesInAssemblies(IBuildManager buildManager, Predicate`1 predicate)
at System.Web.Http.Dispatcher.HttpControllerTypeCacheUtil.GetFilteredTypesFromAssemblies(String cacheName, Predicate`1 predicate, IBuildManager buildManager)
at System.Web.Http.Dispatcher.HttpControllerTypeCache.InitializeCache()
at System.Web.Http.Dispatcher.HttpControllerTypeCache..ctor(HttpConfiguration configuration)
at System.Web.Http.Dispatcher.DefaultHttpControllerFactory..ctor(HttpConfiguration configuration)
at System.Web.Http.Services.DefaultServiceResolver.<.ctor>b__0(HttpConfiguration config)
at System.Web.Http.Services.DefaultServiceResolver.GetService(Type t)
at System.Web.Http.Services.DependencyResolver.GetService(Type serviceType)
at System.Web.Http.DependencyResolverExtensions.GetService(DependencyResolver resolver)
at System.Web.Http.DependencyResolverExtensions.GetServiceOrThrow(DependencyResolver resolver)
at System.Web.Http.DependencyResolverExtensions.GetHttpControllerFactory(DependencyResolver resolver)
at System.Web.Http.Dispatcher.HttpControllerDispatcher..ctor(HttpConfiguration configuration)
at System.Web.Http.HttpServer..ctor(HttpConfiguration configuration)
at System.Web.Http.HttpServer..ctor()
at Tests.Reporting.EndToEnd.get_today_daily_activity.<.ctor>b__0() in get_today_daily_activity.cs: line 21</div> <div class="stacktrace"></div>
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Cannot create HttpServer from a test run by ReSharper
Mar 03, 2012 03:36 PM|LINK
This seems like something related to ReSharper, not Web API. You should try contacting JetBrains on their support forums.
ASP.NET Team
@marcind
Blog
Vistor
Member
12 Points
9 Posts
Re: Cannot create HttpServer from a test run by ReSharper
Mar 03, 2012 04:06 PM|LINK
Why do you think it's ReSharper's issue? After all it's Web API that tries to do something on ReSharper's dlls. Just trying to understand.
marcind
Contributor
3344 Points
609 Posts
Microsoft
Re: Cannot create HttpServer from a test run by ReSharper
Mar 03, 2012 04:26 PM|LINK
Not sure how ReSharper's test runner works but it looks like it's copying some binaries into your application's bin folder. Web API searches all bin assemblies for ApiController classes, and it looks like whatever got copied by ReSharper is unable to load some other DLL. You should look at your test project and verify the purpose of the JetBrains.ReSharper.Psi assembly.
ASP.NET Team
@marcind
Blog