8

I am trying to debug the Entity Framework error: Unable to load the specified metadata resource.

All the usual fixes are not working for me, and I would like to actually see if the .csdl, .ssdl and .msl files are in the resource (like they are supposed to be).

If you know a free tool that can do this please answer with it.

Note: I don't have access to Red Gates Reflector. I tried Resharper's new dotPeek, but it just shows code, not resources.

Any idea how I can get at these resources that are supposedly in my dll?

3
  • Even though you may not have access to reflector, they do offer a 14 day trial of the product (assuming you have not already done so)
    – Jesse
    Jul 8, 2011 at 22:14
  • And even after that Standard version is so cheap that you will spend more for single pub visit ... Jul 9, 2011 at 12:08
  • 2
    JetBrain's Resharper dotPeek supports viewing resources now.
    – Jade
    Sep 18, 2017 at 17:49

3 Answers 3

13

Try Telerik's JustDecompile

They promise it will be free forever

Here's a screen shot with the resources node expanded

enter image description here

6

I wonder why @George deleted his answer because ILDASM will indeed show you resources in assembly manifest:

.mresource public Model.csdl
{
  // Offset: 0x00000000 Length: 0x00000394
}
.mresource public Model.ssdl
{
  // Offset: 0x00000398 Length: 0x00000352
}
.mresource public Model.msl
{
  // Offset: 0x000006F0 Length: 0x000002B7
}

Anyway you spend time waiting for answer instead of thinking about tools you have already available. What about writing simple console application which will simply show you resources included in your assembly?

using System;
using System.Reflection;

namespace AssemblyBrowser
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                System.Console.WriteLine("Provide path to assmebly!");
                return;
            }

            try
            {
                var assembly = Assembly.LoadFrom(args[0]);
                foreach (var name in assembly.GetManifestResourceNames())
                {
                    Console.WriteLine("Resource: {0}", name);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: {0}", e.Message);
            }
        }
    }
}
1
  • The names provided by GetManifestResourceNames do not seem to be the same names expected by ResourceManager.GetStream (which is used internally by SplashScreen.Show, the method giving me trouble right now).
    – Grault
    Nov 23, 2022 at 19:46
5

Jetbrains have a great decompiler too - called dotPeek. You can find it here: https://www.jetbrains.com/decompiler/.

I prefer this one over the Telerik one because there's no need to create an account, you can simply download it and install. This is what is looks like

enter image description here

1
  • This is better than Telerik's one since it works for .NET 5/6/7 as well as "no need to create an account, you can simply download it and install".
    – Santosh
    Feb 16 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.