Incorrect Exception - Could not find FirebirdSql.Data.FirebirdClient.resources
------------------------------------------------------------------------------
Key: DNET-488
URL: http://tracker.firebirdsql.org/browse/DNET-488
Project: .NET Data provider
Issue Type: Bug
Environment: Window 7
Reporter: Manfred Roßkamp
Assignee: Jiri Cincura
Priority: Minor
If you cause an exception for example with the following incorrect sql statement:
"select date() from xy"
I get the following exception:
{"Die Datei \"FirebirdSql.Data.FirebirdClient.resources\" konnte nicht gefunden werden.":null}
(Look at the end of this description for the stacktrace)
In my environment i have the following dictionary structure:
MyApp.exe
Firebird\x32\FirebirdSql.Data.FirebirdClient.dll
Firebird\x32\*(32 bit Firebird embedded Version)
Firebird\x64\FirebirdSql.Data.FirebirdClient.dll
Firebird\x64\*(64 bit Firebird embedded Version)
MyApp is compiled in AnyCPU and it load's dynamically the FirebirdSql.Data.FirebirdClient.dll from the correct subfolder.
I solved this problem with the following changes in FirebirdSql.Data.Common.IscException
1. Add the following method to get the correct resource set:
#region - Statics -
private static Dictionary<string, ResourceSet> resources = new Dictionary<string, ResourceSet>();
private static ResourceSet GetResourceSet(string name)
{
ResourceSet result;
if (!resources.TryGetValue(name, out result))
{
using (var resStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(
name + ".resources"))
{
result = new ResourceSet(resStream);
resources[name] = result;
}
}
return result;
}
#endregion
2. Call the specified method instead of creating a new ResourceManager
at
bei System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
bei System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
bei System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
bei System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
bei System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
bei System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
bei System.Resources.ResourceManager.GetString(String name)
bei FirebirdSql.Data.Common.IscException.BuildSqlState()
bei FirebirdSql.Data.Common.IscException.BuildExceptionData()
bei FirebirdSql.Data.Client.Native.FesConnection.ParseStatusVector(IntPtr[] statusVector, Charset charset)
bei FirebirdSql.Data.Client.Native.FesDatabase.ParseStatusVector(IntPtr[] statusVector)
bei FirebirdSql.Data.Client.Native.FesStatement.Prepare(String commandText)
bei FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior)
bei FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteDbDataReader(CommandBehavior behavior)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|