openshac

My code is working fine on my machine (in Debug mode and Release) but when it is deployed to another machine I am getting the following error:

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure ".Resource1.resources" was correctly embedded or linked into assembly "PPPOCogitoImport" at compile time, or that all the satellite assemblies required are loadable and fully signed.

at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at Paypoint.PostilionServices.Cogito.Import.CreateSummaryOMR(String directory, String fileName) in D:\International\Source\Server\PPPO\PPPOCogitoImport\ProcessFile.cs:line 148
at Paypoint.PostilionServices.Cogito.Import.ImportFiles(String serviceName, InvoiceParameters ip) in D:\International\Source\Server\PPPO\PPPOCogitoImport\ProcessFile.cs:line 86
The offending line in the code is:

Code Snippet
string errorMessage = String.Format(CultureInfo.CurrentCulture, Resource1.MissingParameters);

Now I have only one resource file, called Resource1.resx, in my project. I have no problems using this on my machine. The release version of the code is built on a separate "Build" machine and is the deployed to a separate "Test" machine.

Am I correctly using this Resource file in my code or are the culture settings on the other machines incorrect Do I need to ensure that some kind of culture setting is specified on the Build or Test machine or do I need modify my code

I am bit stuck so any help would be much appreciated.

Charlie



Re: Visual C# General Resource String - Culture problems

ben.biddington

As the message reads, your build machine does not seem to embedding the resources file in the output assembly.

Visual Studio must do this for you as part of a build, investigate resgen.exe and al.exe, you may need to change your build process.




Re: Visual C# General Resource String - Culture problems

openshac

Ben,

I think you are right, I've gone to the build machine and can't even run the code.

We keep getting a MissingManifestResourceException.

You mention resgen.exe and al.exe, are these build tools that I need to ensure that the build machine has got, or are they just settings in VS2005 that I need to adjust

Thanks

Charlie





Re: Visual C# General Resource String - Culture problems

ben.biddington

Yep, the build machine'll need to know about them, but it already has the compiler, so probably those too.

The problem may be working how to invoke those tools during your build.

I don't know anything about automated builds, are you using devenv.exe If so I would expect it to run properly and include resources.

<bb />




Re: Visual C# General Resource String - Culture problems

openshac

Ben,

Thanks again for your help.

We are not actually doing automated builds, our "build guy" just builds the project using VS2005 IDE. (This is just using devenv.exe right ). resgen.exe is there on the build machine as well.

Well actually we've tried to simply run the code in debug on the build machine and we get a MissingManifestResourceException at runtime. I guess this narrows it down a bit but I'm still trying to find a fix.

Charlie





Re: Visual C# General Resource String - Culture problems

ben.biddington

And the .resx file is present when he attempts to build

Are there any compiler warnings




Re: Visual C# General Resource String - Culture problems

openshac

Ben,

OK - I've got it licked now.

The namespace in the csproj and the Resource1.Designer.cs files did not match on the build machine.

There are a number of ways to fix this:

1. Update the namespace manually in the csproj file

2. Update the namespace manually in the Resource1.Designer.cs file

3. Right click on the Resource1.Designer.cs file and select "Run Custom Tool" top regenerate the Resource1.Designer.cs file.

Thanks again for all your help Ben - much appreciated.

Charlie