.NET Application looking for DLLs in locale specific sub-folder

My company have some internal utility libraries containing things like base services, useful extension methods etc.

I have recently completely re-written these from the ground up and have packaged them as nu-get packages, hosted on our internal network.

When I’ve added added a NuGet reference to the packages in a project, the application will build, but sometimes when debugging or running it will fail saying that the libraries cannot be found. This seems to be entirely at random, and usually if I re-build and re-deploy the problem will be temporally fixed.

A colleague of mine managed to narrow down the problem by running process monitor, and found that the application was looking for the files to be in bin/en-GB/{MyCompany.DllName}/{MyCompany.DllName}.dll when the file was actually in bin/{MyCompany.DllName}.dll, as I would expect by default.

So as a temporary fix, we can add the folder structure it requires and are able to run the application, but having to re-add the folder structure and manually copy and paste dlls around after every clean/rebuild is not a long term solution. I also don’t know:

  1. Why it sometimes works.
  2. What is causing this behavior.

I don’t know whether the issue is with the utility libraries project, nuget package, or the consuming project.

I realise this is probably some helpful by design .NET feature, allowing locale specific versions of ddls, but in this situation I do not require them, and the dll can be/is culture invariant.

Any help would be massively appreciated as it is holding up the release of our new libraries.

Source: dll

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.