开发者

Is there a way to see the resources that are in a .net dll

开发者 https://www.devze.com 2023-03-18 04:24 出处:网络
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 .

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 res开发者_开发知识库ources.

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


Try Telerik's JustDecompile

They promise it will be free forever

Here's a screen shot with the resources node expanded

Is there a way to see the resources that are in a .net dll


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);
            }
        }
    }
}


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

Is there a way to see the resources that are in a .net dll

0

精彩评论

暂无评论...
验证码 换一张
取 消