i'm building a class library for SQLite , when i build the project the System.Data.SQLite.dll comes as a standalone dll file and i need it to be merged with my class library in a single dll file i added System.Data.SQLite.dll as a ressource then , add / existing item , and then adding it as an embedded resource
then i drop this static constractor in the start of my namespace
static SimpleClass()
{
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
{
if (new AssemblyName(args.Name).Name.ToLowerInvariant() == "System.Data.SQLite")
{
String resourceName = "SQLlite." + new AssemblyName(args.Name).Name + ".dll";
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
{
Byte[] assemblyData = new Byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
return Assembly.Load(assemblyData);
}
}
else
{
return null;
}
};
}
This is giving me errors like error CS1518: Expected class, delegate, enum, interface, or struct appreciate any help from you guys