I am trying to build a test and run a test project that references resource files. The tests work fine in resharper but when nCrunch runs them I get an error stating:
System.Resources.MissingManifestResourceException : Could not find any resources appropriate for the specified culture or the neutral culture.
I believe this is because nCrunch is running with it's current thread culture set to neutral but I haven't got a resource file for that. Is there a way to set the thread current culture for nCrunch? Thanks in advance.
NCrunch will use the default culture for any .NET application on your machine (whatever that may be). There isn't anything specific in NCrunch that tries to control the culture, and it can't be configured in the tool itself. If your tests are culture-specific, you can set the culture using a SetUpFixture (NUnit) or AssemblyInitialize (MSTest) block using the following code:
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
Another possible situation that may cause this problem is if your project is making use of files in the resource manifest that are not included in the project file itself. NCrunch doesn't parse resource manifests, so it won't know about the resource files in order to copy them into workspaces it sets up to build your project. There's a page in the documentation that describes ways in which you can handle implicit file dependencies during project build. Although in theory the references to your resource files are declared explicitly rather than implicitly, NCrunch doesn't have enough knowledge of the workings of the resource compiler to understand the difference. You can either add the resource dependencies directly into your project file or use the 'additional files to include' configuration setting.
Thank you so much for your help. The problem was that the satellite resource assemblies weren't being loaded by ncrunch (like you said). I added those files under the add additional files config setting in ncrunch and now it works.
I'm so happy with the ncrunch product, one of the best purchases I have made. Thanks again for your prompt help!