I have a simple (no authentication yet) Lightswitch VS 2012 app. That on my local computer connects to a mysql database (the database is hosted by my hosting company). All works well.
I then 'publish' this app to my local IIS server, and copy all that to my hosting companies server.
It mostly works, except the WCF service won't work. Upon connecting to the WCF service directly (the .svc file) I get a 'request error'. The stack trace in the Trace.axd is as follows
[Microsoft.LightSwitch.DataService][Application:Error][LightSwitchServiceApplication.vinyldyeData:CreateObjectContext] An exception has occurred: 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)
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
--- End of inner exception stack trace ---
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
at LightSwitchApplication.Implementation.vinyldyeDataServiceImplementation.CreateObjectContext()
at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceImplementation`1.get_ObjectContext()
It looked as though the hosting company just doesn't have the MySQL Connector in the GAC, so i've added this into the bin folder, still get the same error.
I've looked in the Web.configs, and there is no mention of mysql connector, how does the app know which connector to use?
Have you deployed a Lightswitch app to a host using mysql? if so what files am i missing, or config option.
thanks
Since you've already added the MySQL Connector (I assume 6.4.4) DLLs to the bin folder, refer to this post. Worked for me.
Related
-- Background:
I am using asp.net mvc project with 3.1 .net core.
I have azure setup for hosting it in app service.
For Database, I have mysql database server set up on Azure (version 5.7).
-- Problem:
I am using basic connection string when connecting to mysql database. But it is not working for hosted application.
When I connect the azure hosted database server locally using WorkBench, and run the program (locally), it 'works'. (WorkBench connection has Ssl = required and SSL cert File attached.)
But when I publish the same code with same connectionString, it is not working.
IS IT BCZ OF:
I am using 5.7 azure mysql database server?
(To update the version, do I need to create new mysql server on azure and pay $20? Because Mycrosoft documentation says there is 'Upgrade' option on overview. But there is not. Or might for higher subscription. Any suggestions?)
If the reason is I am missing mentioning ssl certi on hosted platform, how can I add it? Do I need to get storage to store that certificate? How can I mention that path in connectionString?
Any other reason for this problem?
I checked YouTube, Microsoft documents, And Google but didn't find solution.
UPDATE:
Libraries used:
MySql.EntityFrameworkCore 3.1.X
Microsoft.EntityFrameworkCore 3.1.X
MySql-Connector-Net 8.0.X
Connection String used: "Server=.mysql.database.azure.com;Port=3306;Database=;Uid=;Pwd=;"
Solution:
It was unable to connect because of incomplete networking.
I had to allow other azure services to connect that server.
Thanks for your comments.
I have a MySQL server database running on Azure. It has already running to store data from my ASPX web apps hosted on Azure also. I have plan to migrate the apps to Java JSF or .net core.
I developed using Tomcat server (in my local pc) and try to connect directly to mySql in Azure. But I always get Communications link failure error.
Is it not allow to connect directly from my local Tomcat server to database in Azure, or something else?
Thank you in advance for the answer.
Yes you can connect from your local tomcat to your azure mysql if you have provided the correct connection string.
Also add your ip in the firewall rules of the sql resource.
I’m am trying to use Microsoft WebMatrix version 3 to create and publish a WordPress site to an IIS 8.0 server.
I have created the WordPress site from the WebMatrix App Gallery and as part of this process MySQL has been installed locally on my PC.
I have configured the IIS server for Web Deploy. I have created a website in IIS, I would like to publish my new wordpress site to. I also created a remote database on another server which has MySQL server installed. As part of the publish process, I would like the local database to get published to this remote database. As of now, it is an empty database with a valid username and password.
From within IIS, when I create the publish settings file I get the following error:
"Unable to establish a connection to the MySQL database using the supplied connection string. Would you like to add the connection string to the XML settings file"
I click save and proceed.
When I use this settings file to validate the connection inside Web Matrix. I get the following error.
"The remote server connection succeeded, but Microsoft WebMatrix cannot access databases."
Related info. I have verified that my remote database is available by connecting to it directly from within Web Matrix. The port 3306 is open. I don't know what else I need. Stumped for several days now :-(
Any suggestion will be greatly appreciated.
I've hosted MVC application having MySql server instance in AppHarbour as backend but build is getting failed. We would like to connect MySql instance from local application but it can't access tables and schema while is opening and connecting to instance successfully.
You can't connect AppHarbor to a local db. If you have a hosted MySql instance though, you can connect it to that.
AppHarbor shows you build errors. You can read the build output and find out why it is failing (if it is the build failing or unit tests failing).
Either way, whether or not MySql is hosted or local, that shouldn't affect whether or not the project builds in AppHarbor.
I'm trying to connect to an existing MySQL DB from Lightswitch RTM through a WCF RIA service.
I did the following:
Install MySQL connector version 6.3.7 from MySQL developer zone on my development machine. The lastest version 6.4.3 does not seem to work and gives an error "Out of sync with server" when establishing a connection from within Visual Studio.
Test the connection from Visual Studio by creating a new data connection, selecting MySQL database as provider, and providing the MySQL server IP address, the user name and password.
This works and the DB shows up correctly.
Then I followed the tutorials here to use create a WCF RIA service:
Add a new project to the solution based on the template WCF RIA Services class library.
Add an ADO.NET entity data model to the WCF RIA Web project and using the wizard connect it to the MySQL database. The generated connection string is
metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=MySql.Data.MySqlClient;provider connection string="server=10.192.xx.yy;User Id=xxxxxxx;database=projet;password=xxxxxxxxxx;Persist Security Info=True".
Add a domain service to the WCF RIA Web project.
This works correctly. The entity diagram shows the three selected tables of the database with all fields.
Then I connected the WCF RIA service to lightswitch following this tutorial here:
In the Lightswitch project, create a new data source and attach it to the WCF RIA service
Add a reference to the WCF RIA Web project and select the required data source objects. This works and the data source objects are correctly imported.
Finally copy the connection string from the WCF RIA Web project file App.config to the file web.config in the server generated project of the Lightswitch project. The line is:
<add name="b70821ef-..." connectionString="metadata=res:///Model.csdl|res:///Model.ssdl|res://*/Model.msl;provider=MySql.Data.MySqlClient;provider connection string="server=10.192.xx.yy;User Id=xxxxxxx;database=projet;password=xxxxxxx;Persist Security Info=True"" providerName="System.Data.EntityClient"/>
The solution can be built without errors. However, when running the Lightswitch application, the details screen for the MySQL table only shows a red cross and indicates that it cannot load the data.
I suspect that the connection string pasted to web.config is wrong.
What is wrong/missing in the above approach or how can I isolate and debug the problem?
Follow this post.
http://lightswitchhelpwebsite.com/Forum/tabid/63/aft/89/Default.aspx
For me it was the solution-> see the last point about config of coonection string
regards