Posted 13 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 4.0.0287
Avatar
Hello,

I'm running into a Resources.MissingManifestResourceException when using the .Net-Addon in SyntaxEditor.
The problem is, that the error messages are not correctly embedded. A call like AssemblyInfo.Instance.Resources.GetString("SemanticParserError_NamespaceMemberDeclarationExpected") produces this exception.
I am quite confused what exactly causes the problem. I have tried several things, some worked but have side effects I would like to avoid (for example changing namespaces or assembly names).
We are building the Addon ourselves, because we need to do some minor modifications.
All the sources are packed into a .Net4 project. The source files from the .Net-Addon are all in a sub directory of the project. We have not changed the names, namespaces or file structure of any file. However our own files have a different namespace.

Our file structure looks basically like this:
trunk
...
- CompanyNamespace.Languages.CS
| - Editor
| | - Products
| | - SyntaxEditor.Addons.CSharp
| | - SyntaxEditor.Addons.DotNet
| | | ...
| | - SyntaxEditor.Addons.VB
| - MyOwnFile.cs
...
Message=Could not find any resources appropriate for the specified culture or the neutral 
culture. Make sure "ActiproSoftware.Products.SyntaxEditor.Addons.DotNet.Strings.resources" 
was correctly embedded or linked into assembly "CompanyNamespace.Languages.CS" at 
compile time, or that all the satellite assemblies required are loadable and fully signed.


Best regards, Tobias Lingemann.

Comments (5)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tobias,

That is the code that retrieves string resources. So as the message indicates you need to have that .resources file embedded with the resource path it indicates so that it can be found by the code that retrieves string resources.

You can use programs like Reflector to see the path of your resources, if you are trying to debug why they aren't found. Note that folder paths do get included as part of the resource path, so changing folder structure will likely cause this issue, such as if you moved the .NET add-on's files into a new folder structure or if your application has a default namespace.


Actipro Software Support

Posted 13 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar
Thanks for your answer. I can live with the resolution, but find it still unfortunate. Not a big deal, just not very elegant.
Basically we have to do two things:
- The folder 'Products' has to be in the root folder of the project.
- The default namespace of the project has to be 'ActiproSoftware'.

I still don't understand why you don't use the default .Net-pattern for resource files. In that case, there would not be any problem at all. For me it is just important to minimize any effort, when upgrading to a new version.

Quick question on the side. The resource files only contain English messages, right? To implement different languages my first thought would be to make my own resource file and replace any AssemblyInfo.Instance.Resources.GetString() with the appropriate Properties.Resources call.
Or should I rather stay with your pattern? If so, are Asian languages supported?


Best regards, Tobias Lingemann.

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tobias,

The string resources portion was written in VS 2002 / .NET 1.0 before VS had the more elegant string resources project tab. That being said, we're currently working on a large update to the WinForms control projects where they are being converted to VS 2010. Part of that is changing the string resources over to use the newer VS string resources dialog.

You can change the path you need it to be by going to our Resources class and overriding this property:
protected override string StringResourcesName { get; }
Change that to whatever resource path that .strings file ends up at in your assembly.

Even though our string resources are added the old way right now, they are still string resources and are loaded up using a ResourceManager. This means that if you create a satellite assembly with your culture-specific resources they should override our default ones if you run in that culture. Or alternatively you can use methods like our Resources.SetCustomString to programmatically set overrides for each string resource.

Any language should be supported since strings are Unicode.


Actipro Software Support

Posted 13 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar
Oh, I thought everything was .Net2.0.
Thanks, that should work.


Best regards, Tobias Lingemann.

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Tobias,

It is .NET 2.0 now, I'm just saying the product was first written in .NET 1.0 and the string resource piece has carried over from that.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.