none
Visual Studio 是如何打开一个不含有manifest.的资源文件dll的 RRS feed

  • 问题

  • 有一个资源文件abclang.dll
    在使用 Assembly myAssembly = Assembly.LoadFrom(DllPath);方法的时候提示为
    Could not load file or assembly 'file:///C:\Documents and Settings\abclang.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
    但是直接拖到visual studio中的时候,可以打开,请问Visual studio 是如何打开的?
    如果我需要在code中操作,如何编写代码?

    希望大家能给些提示,谢谢~


    OS:windows XP SP3
    VS:2008 professional edition

    the same problem with Y.tks
    2009年9月16日 3:03

答案

全部回复

  • LoadResource 

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    2009年9月16日 3:30
    版主
  • Thanks a lot.
    the same problem with Y.tks
    2009年9月16日 6:00
  • LoadResource 

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP


    Would you please give me an example,I am not familar with c&c++.

    I tried to search the web,especially the MSDN I   found this.

    at c# could use the :

         [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)]
         internal static extern IntPtr LoadResource(IntPtr hModule, IntPtr lpResourceInfo);

         [System.Runtime.InteropServices.DllImport("Kernel32.dll")]
         public static extern IntPtr LoadLibrary(string lpFileName);

          [DllImport("kernel32.dll", SetLastError = true)]
          public static extern IntPtr FindResourceEx(IntPtr hModule, IntPtr type, IntPtr name, ushort langId);

    how to use the function FindResourceEx in C# ? could you give me an example?
    Thank you very much


    the same problem with Y.tks
    2009年9月17日 1:51
  • http://social.msdn.microsoft.com/Forums/en-US/clr/thread/1486d679-5c35-4b1c-b29f-58b7e3e809f9

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    • 已标记为答案 shoucal 2009年9月17日 3:00
    2009年9月17日 1:55
    版主
  • Get it ,Thanks very much !~
    the same problem with Y.tks
    2009年9月17日 3:00