不用Code1. Add Existing Item - Add your unmanaged dll
2. Set it as Content
3. Set “Copy to Output Directory" - ”Copy if newer“
4. In your installer project, make sure to include content files

解决方案 »

  1.   

    就将数据读出再写到文件吧System.IO.Stream fs = GetType().Assembly.GetManifestResourceStream("Project_name.mydll.dll");
    FileStream fs2 = File.Create(@"mydll.dll");
    BinaryReader binReader = new BinaryReader(fs);fs2.Write( binReader.ReadBytes((int)fs.Length),0,(int)fs.Length );binReader.Close();
    fs.Close();
    fs2.Close();
      

  2.   

    UnmanagedMemoryStream;Properties.Resources.樱花草;是什么来的?我用GetType().Assembly.GetManifestResourceStream("Project_name.mydll.dll"); 可以啊,和其它文件类型没什么不同。再不行后序改名不就得了吗
      

  3.   

    动态调用,不使用[DllImport("MyDll.dll", EntryPoint = "wlDeletry")] 
    用LoadLibrary,GetProcAddress
      

  4.   

    这种方式:用ILMerge.exe将dll合并到exe中
      

  5.   

    动态调用可以看我的这个:
    http://blog.csdn.net/null1/archive/2009/03/03/3953155.aspx然后不使用DllImport就差不多了。
      

  6.   

    楼主是引用了一个Dll文件,又不想看到看到它,删了程序运行出错,就想把Dll藏在可执行文件里,需要用的时候再放出来,退出程序的时候再删掉,是这意思吧?
    想法新奇,思维大胆,我试验一下看有什么方法
      

  7.   

    弱弱地问一下,要是我同时运行两个实例时会不会控制起来很麻烦?
    生成2个DLL?
    释放时还得看这个Dll是否被调用?或者生成DLL和调用DLL时动态改名?
    要是有以上问题这样做是不是得不偿失