I am using Firebird embedded in an Asp.Net Web Site. When I run VS2010 as administrator I can successfully call the database, if I run it as a different user I get this error:
System.IO.IOException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Reflection.Emit.ModuleBuilder.SavePEFile(RuntimeModule module, String fileName, Int32 entryPoint, Int32 isExe, Boolean isManifestFile)
at System.Reflection.Emit.ModuleBuilder.Save(String fileName, Boolean isAssemblyFile, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at System.Reflection.Emit.AssemblyBuilder.SaveNoLock(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at System.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)
at System.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName)
at FirebirdSql.Data.Client.Native.FbClientFactory.CreateInstance(TypeBuilder tb)
at FirebirdSql.Data.Client.Native.FbClientFactory.GenerateFbClient(String dllName)
at FirebirdSql.Data.Client.Native.FbClientFactory.GetFbClient(String dllName)
at FirebirdSql.Data.Client.Native.FesDatabase..ctor(String dllName, Charset charset)
at FirebirdSql.Data.FirebirdClient.ClientFactory.CreateDatabase(FbConnectionString options)
at FirebirdSql.Data.FirebirdClient.FbConnectionInternal.Connect()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.Create()
at FirebirdSql.Data.FirebirdClient.FbConnectionPool.CheckOut()
at FirebirdSql.Data.FirebirdClient.FbConnection.Open()
I've deployed the service in IIS but I get the same error when calling it. Also, to make it work under the admin account I had to copy fbemdeb.dll in windows/system32.
I've done the same call to the DB from within a console application and it works for all user accounts. I only have this problem with the web service.
Any suggestions? i am using Firebird 2.5
Sounds like a permission problem. The user that runs the app pool probably can't save on disk. This is suggested by the stack trace you've sent:
at System.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName)
Looks like the Firebird API you're uses some technique to build an assembly in runtime. I would look in the API documentation to see if there's a way to configure any temporary directories or something like that.