Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find the requested .Net Framework Data Provider. It may not be installed

Hi it is my first time that I publish a project deveolped with entity framework in a remote server. The pages work fine but when I try to access in my reserved area and so, reading a dabatase, I obtain this error

Unable to find the requested .Net Framework Data Provider. It may not be installed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.]
System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1402071
System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +35

[ArgumentException: The specified store provider cannot be found in the configuration, or is not valid.]
System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +62
System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +263
System.Data.EntityClient.EntityConnection..ctor(String connectionString) +81
System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString) +42
System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +16
shield_trust.db_shieldtrustEntities..ctor() in D:\trust-company\shield_trust\shield_trust\POCO.Context.cs:23
shield_trust.user_login.check_login() in D:\trust-company\shield_trust\shield_trust\user_login.aspx.cs:65
shield_trust.user_login.entraButton_Click(Object sender, EventArgs e) in D:\trust-company\shield_trust\shield_trust\user_login.aspx.cs:25
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

I have to copy some dll into my bin folder or modify my web.config?

like image 548
P_R Avatar asked Jan 16 '14 08:01

P_R


People also ask

Can Python be used in .NET framework?

Python.NET ( pythonnet ) is a package that gives Python programmers nearly seamless integration with . NET Framework, . NET Core and Mono runtime on Windows, Linux and macOS. Python.NET provides a powerful application scripting tool for .

Where is machine config located?

The machine. config file is stored in the %WINDIR%\Microsoft.NET\Framework folder in the directory where Microsoft Windows is installed. By default, it is located in the following path: C:\WINDOWS\Microsoft.NET\Framework\v1. 1.4322\CONFIG.

Which one of the following data providers is not included in Ado net framework?

NET Framework Data Provider for OLE DB. This includes the Microsoft OLE DB provider for Exchange and the Microsoft OLE DB provider for Internet Publishing. The . NET Framework Data Provider for OLE DB does not work with the OLE DB provider for ODBC (MSDASQL).


2 Answers

Try running this to get a list of installed providers, and check yours is there:

// This example assumes a reference to System.Data.Common.
static DataTable GetProviderFactoryClasses()
{
    // Retrieve the installed providers and factories.
    DataTable table = DbProviderFactories.GetFactoryClasses();

    // Display each row and column value.
    foreach (DataRow row in table.Rows)
    {
        foreach (DataColumn column in table.Columns)
        {
            Console.WriteLine(row[column]);
        }
    }
    return table;
}

UPDATE: You need to have the MySQL Provider installed on the target machine, it's called something like "MySQL Connector Net x.x.x" Which you can get from this website

like image 63
Paul Zahra Avatar answered Sep 20 '22 18:09

Paul Zahra


With our applications (ASP.NET, Test, Windows Service), we've had to add the below to our app.config or web.config files (inside the configuration node) to make this work:

<system.data>
        <DbProviderFactories>
            <remove invariant="MySql.Data.MySqlClient" />
            <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
        </DbProviderFactories>
    </system.data>
like image 38
udog Avatar answered Sep 18 '22 18:09

udog