Windows Service .NET 2.0 MissingManifestResourceException

I have a simple windows service that was created in vs2005, it uses the
FileSystemWatcher class to watch for directory changes, and if an error
occurs it logs it to the event log. I have used the new Resources
designer to define a few common errors I would like to write to the
event log.

Other than my machine, all clients that are testing are getting the
MissingManifestResourceException that is being written to the eventlog,


System.Resources.MissingManifestResourceException: Could not
find...Make sure"SOXFileSysProperties.Resources.resources" was
correctly embedded or linked into assembly "SOXFileSysWatcher" at
compile time, or that all the satellite assemblies required are
loadable and fully signed. etc.....

I have signed my app, ran against FXCop to ensure all requirements are
being used.


I have a few lines in try/catch that will write as follows

catch(MissingMemberException mme)
{
eventLog1.WriteEntry(string.Format(CultureInfo.CurrentCulture,
"{0}{1}{2}", mme.ToString(), Environment.NewLine,
SOXFileSysWatcher.Properties.Resources.HelpString),
EventLogEntryType.Error);
}

BTW any good reference sites for Windows Service writing, seen
Windowsforms.net, asp.net, etc... but can't seem to find anything
dedicated to windows services, i.e. WindowsServices.net

Thanks for your help


Answer this question

Windows Service .NET 2.0 MissingManifestResourceException

  • ericsstoll

    Thank you Cleo, I will check out the test code and compare, I thought it would be fairly easy with the new designer etc... I must have missed something in MSDN Help

    Thanks again


  • Ralphxyz

    Hi Josh,

    Cheers! Thanks for your feedback. New way of Resource Management setting has been adopted in VS 2005. And you can find more on that in MSDN online help. Please pay attention to our newly-updated support in that network.

    We very much value your comments and look forward to further feedback from you. Please feel free to ask if you have any questions.

    Best regards,

    Cleo



  • Sergio G

    Hi Josh Crosby,

    Based on my investigation, I clearly understand your problem, which's the programming problem of ResourceManager rather than windows Service programming. Do you program with ResourceManager class in your code

    I can reproduce your exception System.Resources.MissingManifestResourceException

    Please pay close attention to ResourceManager constructor:

    public ResourceManager (
    string baseName,
    Assembly assembly
    )

    baseName is the root name of the resources. For example, the root name for the
    resource file named "MyResource.en-US.resources" is "MyResource". You can use Reflector to see your assembly namespace.

    Sample code of localization about how to write construct a
    ResourceManager instance correctly in code:

    1.Full Code:
    http://lilybbs.net/file/X/xiaodudu/ResTest.rar

    2.Code snapshot:

    System.Resources.ResourceManager gStrings =new System.Resources.ResourceManager
    ("Resources.string", Assembly.Load("App_GlobalResources"));
    PS: (resource file system structure under the project)

    -ProjectName

    -App_GlobalResources

    -string.resx

    -string.en-US.resx

    -string.zh-CN.resx

    - .....





  • Terry Hutt

    I had the same problem and now thanks to you my site works. The explanations for the ResourceManager's parameters are not wery clear; using VS .NET 2005 web site project, the "Page" class is not included in any "namespace" (like in the 2003 version I think ...)that usualy formed the "baseName" ("<namespace.resourcename>"). And then the Assembly.Load function is kind of tricky too.

    Thank you again.


  • zkent

    Hi Josh Crosby,

    Based on my investigation, I clearly understand your problem, which's the programming problem of ResourceManager rather than windows Service programming. Do you program with ResourceManager class in your code

    I can reproduce your exception System.Resources.MissingManifestResourceException

    Please pay close attention to ResourceManager constructor:

    public ResourceManager (
    string baseName,
    Assembly assembly
    )

    baseName is the root name of the resources. For example, the root name for the
    resource file named "MyResource.en-US.resources" is "MyResource". You can use Reflector to see your assembly namespace.

    Sample code of localization about how to write construct a
    ResourceManager instance correctly in code:

    1.Full Code:
    http://lilybbs.net/file/X/xiaodudu/ResTest.rar

    2.Code snapshot:

    System.Resources.ResourceManager gStrings =new System.Resources.ResourceManager
    ("Resources.string", Assembly.Load("App_GlobalResources"));
    PS: (resource file system structure under the project)

    -ProjectName

    -App_GlobalResources

    -string.resx

    -string.en-US.resx

    -string.zh-CN.resx

    - .....

    I sincerely hope it helps. I very much value your comments and look forward to further feedback from you. Please feel free to ask if you have any questions.

    Best regards,

    Cleo



  • AvinashA

    The MissingManifestResourceException is seen when you are attempting to get resources not found in the manager.

    Ensure that an item with the name you are requesting exists - and remember it's case-sensitive.


  • Windows Service .NET 2.0 MissingManifestResourceException