dbTalk Databases Forums  

ASA 11.01 - Client-installation and the entity-framework

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss ASA 11.01 - Client-installation and the entity-framework in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael E.
 
Posts: n/a

Default ASA 11.01 - Client-installation and the entity-framework - 02-16-2010 , 05:11 AM






hello
i have trouble to install a .net-application with entity-framework and
the asa-11.1-client on a new pc (32bit windows-7).
i created in the anywhere-deployment-assisten a setup-file with SQL-
Anywhere (32-bit) and choose only all "Client interfaces", but i alway
get the following error-message:
System.ArgumentException: The specified store provider cannot be
found in the configuration, or is not valid. --->
System.ArgumentException: Unable to find the requested .Net Framework
Data Provider. It may not be installed.
at System.Data.Common.DbProviderFactories.GetFactory( String
providerInvariantName)

which component from ASA-11 i must install on the pc., therewith
my .net-application works fine ??

have anyone a clue for my problem?
many thanks & best regards
Michael

Reply With Quote
  #2  
Old   
blackbird
 
Posts: n/a

Default Re: ASA 11.01 - Client-installation and the entity-framework - 02-21-2010 , 10:00 PM






Michael

Not sure if this reply is too late, but I have had this issue with
deployment installers too, and have had to file a few support cases to
resolve. Unfortunately, the deployment installer misses a few vital
steps, which I have had to put into my application installer, in order
to fix the issue. Basically, you have to explicity add the provider
to the machine.config file, and register the policy with the GAC to
allow different versions of SQL Anywhere 11.

This is my code, where the GAC class is taken from
http://social.msdn.microsoft.com/For...7-a46dbf38f13d

Hope this helps!

[RunInstaller(true)]
public partial class InstallActions : Installer
{

private const string SQLANY11 = "SQLANY11";

private const string DATABASE_DESCRIPTION = ".Net Framework Data
Provider for SQL Anywhere 11";
private const string DATABASE_INVARIANT =
"iAnywhere.Data.SQLAnywhere";
private const string DATABASE_NAME = "SQL Anywhere 11 Data
Provider";
private const string DATABASE_TYPE =
"iAnywhere.Data.SQLAnywhere.SAFactory, iAnywhere.Data.SQLAnywhere,
Version=11.0.1.23522, Culture=neutral,
PublicKeyToken=f222fc4333e0d400";

private const string POLICY_RELATIVE_PATH = @"Assembly\V2\policy.
11.0.iAnywhere.Data.SQLAnywhere.dll";

protected override void OnCommitted(IDictionary savedState)
{
base.OnCommitted(savedState);

try
{
string sqlPath = SQLAnywhereDir();

AddDBProviderFactory();

GAC.Register(Path.Combine(sqlPath, POLICY_RELATIVE_PATH));
}
catch { }
}

protected override void OnBeforeRollback(IDictionary savedState)
{
base.OnBeforeRollback(savedState);

try
{
string sqlPath = SQLAnywhereDir();

RemoveDBProviderFactory();


GAC.Unregister(Path.GetFileNameWithoutExtension(Pa th.Combine(sqlPath,
POLICY_RELATIVE_PATH)));

}
catch { }

}

protected override void OnBeforeUninstall(IDictionary savedState)
{
base.OnBeforeUninstall(savedState);

try
{
string sqlPath = SQLAnywhereDir();


GAC.Unregister(Path.GetFileNameWithoutExtension(Pa th.Combine(sqlPath,
POLICY_RELATIVE_PATH)));

RemoveDBProviderFactory();

}
catch { }
}

private void AddDBProviderFactory()
{
XmlDocument MachineConfigXMLFile = new XmlDocument();

try
{
Configuration MachineConfiguration =
ConfigurationManager.OpenMachineConfiguration();
string MachineConfigurationPath =
MachineConfiguration.FilePath;

MachineConfigXMLFile.Load(MachineConfigurationPath );

XmlNodeList NodesFound = MachineConfigXMLFile.SelectNodes("/
configuration/system.data/DbProviderFactories/add[@name='" +
DATABASE_NAME + "']");

if (NodesFound.Count != 0)
{
Console.WriteLine("File " + MachineConfigurationPath + "
already has an entry for SQL Anywhere. Removing First");
RemoveDBProviderFactory();
MachineConfigXMLFile.Load(MachineConfigurationPath );
}

XmlNode DBProviderFactoriesNode =
MachineConfigXMLFile.SelectSingleNode("/configuration/system.data/
DbProviderFactories");

XmlElement NewElement =
MachineConfigXMLFile.CreateElement("add");

XmlAttribute NameAttribute =
MachineConfigXMLFile.CreateAttribute("name");
XmlAttribute InvariantAttribute =
MachineConfigXMLFile.CreateAttribute("invariant");
XmlAttribute DescriptionAttribute =
MachineConfigXMLFile.CreateAttribute("description" );
XmlAttribute TypeAttribute =
MachineConfigXMLFile.CreateAttribute("type");

NameAttribute.Value = DATABASE_NAME;
InvariantAttribute.Value = DATABASE_INVARIANT;
DescriptionAttribute.Value = DATABASE_DESCRIPTION;
TypeAttribute.Value = DATABASE_TYPE;

NewElement.Attributes.Append(NameAttribute);
NewElement.Attributes.Append(InvariantAttribute);
NewElement.Attributes.Append(DescriptionAttribute) ;
NewElement.Attributes.Append(TypeAttribute);

DBProviderFactoriesNode.AppendChild(NewElement);

MachineConfigXMLFile.Save(MachineConfigurationPath );

Console.WriteLine("File updated successfully");
}
catch (Exception ex)
{
Console.WriteLine("An exception occurred " + ex.Message);
}
finally { }
}

private void RemoveDBProviderFactory()
{
XmlDocument MachineConfigXMLFile = new XmlDocument();
try
{
Configuration MachineConfiguration =
ConfigurationManager.OpenMachineConfiguration();
string MachineConfigurationPath =
MachineConfiguration.FilePath;

MachineConfigXMLFile.Load(MachineConfigurationPath );

XmlNodeList NodesFound = MachineConfigXMLFile.SelectNodes("/
configuration/system.data/DbProviderFactories/add[@name='" +
DATABASE_NAME + "']");

if (NodesFound.Count == 0)
{
Console.WriteLine("SQL Anywhere entry not found to
remove.");
}
else
{
XmlNode DBProviderFactoriesNode =
MachineConfigXMLFile.SelectSingleNode("/configuration/system.data/
DbProviderFactories");

foreach (XmlNode node in NodesFound)
{
try
{
DBProviderFactoriesNode.RemoveChild(node);
}
catch (ArgumentException) { }
}

MachineConfigXMLFile.Save(MachineConfigurationPath );

Console.WriteLine("File updated successfully");
}
}
catch (Exception ex)
{
Console.WriteLine("An exception occurred " + ex.Message);
}
finally { }
}

private string SQLAnywhereDir()
{
string sqlPath = Environment.GetEnvironmentVariable(SQLANY11,
EnvironmentVariableTarget.Machine);

return sqlPath;
}

}



On Feb 16, 6:11*pm, "Michael E." <michael.erlin... (AT) hotmail (DOT) com> wrote:
Quote:
hello
i have trouble to install a .net-application withentity-frameworkand
the asa-11.1-client on a new pc (32bit windows-7).
i created in the anywhere-deployment-assisten a setup-file with SQL-
Anywhere (32-bit) and choose only all "Client

Client interfaces", but i alway
get the following error-message:
* * System.ArgumentException: The specified store provider cannot be
found in the configuration, or is not valid. ---
System.ArgumentException: Unable to find the requested .NetFramework
Data Provider. *It may not be installed.
* *at System.Data.Common.DbProviderFactories.GetFactory( String
providerInvariantName)

which component from ASA-11 i must install on the pc., therewith
my .net-application works fine ??

have anyone a clue for my problem?
many thanks & best regards
Michael

Reply With Quote
  #3  
Old   
M.Erlinger
 
Posts: n/a

Default Re: ASA 11.01 - Client-installation and the entity-framework - 02-22-2010 , 02:58 AM



Hello blackbird

thanks for your reply - is not too late!!

i have a question to your source-sample - where have you installed
these source code?
Unfortunately i have not much experience with deployment and the
creation of SetupProjects in Visual-Studio.

thanks for help in advance & regards
Michael


On 22 Feb., 04:00, blackbird <adam.c.k... (AT) gmail (DOT) com> wrote:
Quote:
Michael

Not sure if this reply is too late, but I have had this issue with
deployment installers too, and have had to file a few support cases to
resolve. *Unfortunately, the deployment installer misses a few vital
steps, which I have had to put into my application installer, in order
to fix the issue. *Basically, you have to explicity add the provider
to the machine.config file, and register the policy with the GAC to
allow different versions of SQL Anywhere 11.

This is my code, where the GAC class is taken fromhttp://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/7d...

Reply With Quote
  #4  
Old   
blackbird
 
Posts: n/a

Default Re: ASA 11.01 - Client-installation and the entity-framework - 02-22-2010 , 08:19 AM



It is quite easy, but there are lots of walk throughs online in case I
miss something:

1. In your normal project (or any project with an executable output)
add an Installer Class item, and call it whatever you like.
2. View the code of this, and override the OnCommitted methods as in
my code above
3. In your deployment project, View Custom Actions and add the primary
output of your project from 1) to each of the 4 steps of the install

This will then run the appropriate code on install, or uninstall etc

Hope that helps

Adam


On Feb 22, 3:58*pm, "M.Erlinger" <michael.erlin... (AT) hotmail (DOT) com> wrote:
Quote:
Hello blackbird

thanks for your reply - *is not too late!!

i have a question to your source-sample - where have you installed
these source code?
Unfortunately i have not much experience with deployment and the
creation of SetupProjects in Visual-Studio.

thanks for help in advance & regards
Michael

On 22 Feb., 04:00, blackbird <adam.c.k... (AT) gmail (DOT) com> wrote:



Michael

Not sure if this reply is too late, but I have had this issue with
deployment installers too, and have had to file a few support cases to
resolve. *Unfortunately, the deployment installer misses a few vital
steps, which I have had to put into my application installer, in order
to fix the issue. *Basically, you have to explicity add the provider
to the machine.config file, and register the policy with the GAC to
allow different versions of SQL Anywhere 11.

This is my code, where the GAC class is taken fromhttp://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/7d...

Reply With Quote
  #5  
Old   
M.Erlinger
 
Posts: n/a

Default Re: ASA 11.01 - Client-installation and the entity-framework - 02-22-2010 , 10:57 AM



Hello

yes - thanks for your help!!
best regards
Michael

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.