-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not find bin folder when performing unit test with NUnit #26
Comments
This will probably fix it: var binDirectory = Path.Combine(this.GetType().Assembly.Location, "bin"); |
Thanks I've created a PR for the change. EDIT: didn't work will look again later. |
My suggestion was wrong, the location of the Autofac assembly IS the bin folder of the web site, or the folder where the unit tests are, so this would be a better idea: var binDirectory = this.GetType().Assembly.Location; |
I've updated the PR. I couldn't use "this" since it's a static method. Also while testng I ran into an issue with it trying to load PDB files, so adjusted the "GetFiles" line to only retrieve .dll files. Could you review the PR? |
If you could also take a look at my issue in DD4T.Model dd4t/DD4T.Model#44 I also created a new PR for that. |
Unfortunately this breaks if you run a website in IIS Express. I will see if I can find a solution that works in every scenario |
How about this? #29 |
Looks good thanks. |
Hello, when can we expect a new version release? Is there anything else required? |
When using this nuget to set up autofac for unit testing it's not working. It's searching for the assemblies in the wrong (non-existant) folder.
AppDomain.CurrentDomain.BaseDirectory is already pointing to the bin folder, so adding "bin" to the end here:
var binDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin");
results in "/bin/bin" as the path when unit testing.
The text was updated successfully, but these errors were encountered: