Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

ArgumentException during bootstrapping when there are no views #143

Closed
sagacity opened this issue May 22, 2011 · 6 comments
Closed

ArgumentException during bootstrapping when there are no views #143

sagacity opened this issue May 22, 2011 · 6 comments
Assignees
Labels

Comments

@sagacity
Copy link
Contributor

Hi,

Recently there have been some refactorings in the bootstrappers and conventions, and now I get an ArgumentException in the DefaultViewLocator when it is trying to find views.

In my project I don't have any views since it is a REST-based app that only returns JSON.

I tried to patch this, but it seems that there are still additional exceptions being thrown during initial bootstrapping when I try to unit test everything, since the Nancy.Testing code only finds "FakeNancyModule" after the bootstrapping process, which seems to indicate that the bootstrapping process failed somehwere halfway through.

So I guess a "no views" application is not functioning properly at the moment. I can spend some time figuring out the exact cause, but I just want to put this out there, since it may be trivial to fix for you.

Roy

@thecodejunkie
Copy link
Member

Roy,

As I read your issue report I immediately get a sense for what is happening. I believe the issue to be in the new view convention code and should be easy to resolve. I will investigate and resolve during the day. Thank you!

@sagacity
Copy link
Contributor Author

Excellent! I'll keep watching the repo and let you know if the fix takes care of the problem I'm seeing. If you need more detailed diagnostics I can provide those as well, of course (if I know where to look :)).

@thecodejunkie
Copy link
Member

Pushed out some fixes to the master repo. Please let me know if this resolved the issue you were seeing. Thanks you!

@ghost ghost assigned thecodejunkie May 24, 2011
@sagacity
Copy link
Contributor Author

This fix solves the startup problems for the regular application, that's good.

The bad thing is, is that the unit testing project still doesn't resolve the modules properly (only the FakeNancyModule gets registered). I'm just using a simple bootstrapper derived from DefaultBootstrapper and I did override the RootPathProvider property because otherwise I get an ArgumentNullException in FileSystemViewLocationProvider.cs: line 43.

@sagacity
Copy link
Contributor Author

I've just spent some time getting a repro scenario up and running, and I couldn't get it to fail :)
So I think this issue can be closed, since the unit testing problems seem to be unrelated.

And, again, I can confirm that this commit DOES solve the startup problems. Thanks for the help!

@sagacity
Copy link
Contributor Author

I found why the module didn't get loaded properly in the tests. Apparently I need to add this to my bootstrapper:

AppDomainAssemblyTypeScanner.LoadAssemblies(@"MyAssemblies*.dll");

Any idea how I can avoid this?

@sagacity sagacity reopened this May 30, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants