Loading Unmanaged DLL fbembed.dll is not ok for embed
so easy way is not do embed.
DEMO APPLICATION
Sure can run for
=====
http://www.codeproject.com/Articles/528178/Load-DLL-From-Embedded-Resource
1、want packget FirebirdSql.Data.FirebirdClient
tools -> NuGet manager - > manager NuGet
find FirebirdSql.Data.FirebirdClient install to project
2、reference -> FirebirdSql.Data.FirebirdClient.dll
a、copy local -> false
b、get full path [copy]
c、right click on Application1 -> add -> Existing item -> use b. path -> chooses file type dll -> find FirebirdSql.Data.FirebirdClient.dll add
f、click reference -> FirebirdSql.Data.FirebirdClient.dll
Build Action -> Embedded Resource
3、open program.css
a、add using System.Reflection;
b、in main() add
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
c、copy this all
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
Assembly assembly = Assembly.GetExecutingAssembly();
//Project_Namespace.Package_Namespace.dll
//Project Namespace = TestProject
//Package Namesapce = Newtonsoft.Json
using (var stream = assembly.GetManifestResourceStream("FirebirdSql.Data.FirebirdClient.dll"))
{
byte[] buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
stream.Flush();
stream.Close();
return Assembly.Load(buffer);
}
}
now run application for release, and see WindowsFormsApplication1\bin\Release
have .exe file, try to run.
======reference=====
http://ponyoth.hateblo.jp/entry/2015/07/28/072718
http://stackoverflow.com/questions/26179554/unable-to-access-embedded-firebird-database-server-with-net-client
http://www.sukitech.com/64/c-wpf-windows-form%EF%BC%8C%E5%B0%87dll%E5%8C%85%E9%80%B2exe%E5%9F%B7%E8%A1%8C%E6%AA%94%EF%BC%8C%E8%A3%BD%E4%BD%9C%E5%96%AE%E4%B8%80%E5%9F%B7%E8%A1%8C%E5%85%8D%E5%AE%89%E8%A3%9D%E6%87%89%E7%94%A8/
http://cyfangnotepad.blogspot.tw/2015/10/cnet-dllexe.html
https://support.microsoft.com/en-us/kb/319292#bookmark-5