The connectionstring property is not initialized - mysql

So, I realize that there are a lot of questions on here pertaining to this problem, but none seem to be the same as to what I'm dealing with. I had to delete my dataset out of visual studio and bring it back in. After doing so I got the error. I'm using mysql as a backend, so I'm using the dotconnect for mysql extension for visual studio. Everything was working fine until I did this step. Here is my app.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="RMSteel.My.MySettings.RMSteelConnectionString" connectionString="User Id=rmsteel;Password=password;Host=192.168.0.46;Database=RMSteel;Persist Security Info=True"
providerName="Devart.Data.MySql" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Whenever I use my connection I use the name RMSteel.My.MySettings.RMSteelConnectionString, since this is auto-generated (I assume by dotconnect). I am fairly far in this project and would like to find a fix using this connection string, so I don't have to rewrite that much. Thanks for any help, and if you'd like me to post more code, I can.

Related

How to set NuGet environment variable NUGET_CERT_REVOCATION_MODE` to false on appcenter.ms

I am working on Xamarin.Forms app that is using a private NuGet feed.
For iOS building, I use appcenter.ms that is recommended by Microsoft. I have set up the NuGet restore step via API key by adding Nuget.config next to .sln file.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="DevOps" value="https://xxx.pkgs.visualstudio.com/_packaging/xxx/nuget/v3/index.json" />
</packageSources>
<apikeys>
<add key="https://xxx.pkgs.visualstudio.com/_packaging/xxx/nuget/v3/index.json" value="%encrypted_api_key%" />
</apikeys>
</configuration>
However, nuget restore on appcenter.ms takes so long that build times-out after 30 minutes.
I suspect that issue is the Revocation check mode
I would need to set the NUGET_CERT_REVOCATION_MODE to false.
How to set NuGet environment variable NUGET_CERT_REVOCATION_MODE to false on appcenter.ms? or disable it some other way?

PageSpeed Insigths and GoDaddy Windows Hosting

I'm having an issue with cache in my webpage.
My webpage is hosted by GoDaddy, with the Economic Windows Server with Plesk.
conexaomktdigital.com.br
It's a very simple site, I DONT USE PHP on it, only HTML, CSS and simple bootstrap JS.
When I run PageSpeed Insights, the results are telling me to optimize browser cache, including adding expire dates to my .css and images.
Mobile: 60/100
Desktop: 75/100
HOW I DO IT? I seek everywhere and don't see anything, everybody talks about .htaccess, but it's not apache, it's windows with plesk by GoDaddy... What should I do, can someone help me?
Create and use a correct 'Web.Config' file. put it in your root folder.
You can find some information about how to use a web.config file with te right tags here:
https://www.giftofspeed.com/leverage-browser-caching/
I use a very simple configuration, it appears to work nice for me:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<caching enabled="true" enableKernelCache="true">
<profiles>
<add extension=".html" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
<add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
</profiles>
</caching>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
this will keep the files listed there in cache until it have some change.
No Error 500 for me, I think it will not happen to you too.

Visual Studio Team Services release XML transformation doesn't work

Visual Studio Team Services - Build & Release
In the release definition, under File Transforms & Variable Substitution Options, there are XML transformation, and XML variable substitution.
I checked both checkboxes, but after deployment, nothing in my Web.Dev.config replaces web.config. The transformation doesn't happen at all.
What is the problem?
--------edit: detail---------
build
all the settings here is default.
release
web.dev.config
This transformation works fine if I deploy from visual studio 2015.
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="DefaultConnection" connectionString="Server=tcp:xxxx.database.windows.net,1433;Database=xxxx;User ID=xxx#xxx;Password=xxxx;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SqlClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
<add name="NicoContext" connectionString="metadata=res://*/Nico.csdl|res://*/Nico.ssdl|res://*/Nico.msl;provider=System.Data.SqlClient;provider connection string="data source=tcp:xxxx.database.windows.net,1433;initial catalog=xxxx;User Id=xxxx#xxxx;Password=xxxx;App=EntityFramework"" providerName="System.Data.EntityClient" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
<appSettings>
<add key="Environment" value="Dev" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
<add key="AzureStorageContainerName" value="xxx" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx;EndpointSuffix=core.windows.net" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" />
<add key="FacebookLoginAppId" value="xxx" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
<add key="FacebookLoginAppSecret" value="xxx" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</appSettings>
</configuration>
--------edit 2: no longer work ---------
I did as the solution suggested on a new project in another Azure account, but this time it didn't work. For build, I choose template "Asp.net (preview)", for release, I choose template "Azure App Service Deployment".
--------edit 3: Release - Package or folder ---------
You have already deployed/published the web app, so the web.config has already been transformed (For web package deployment, the related values in web.config will be updated during web deploy, the values are in parameters.xml).
So, there isn’t other config files (e..g web.dev.config, web.release.config) in published folder and check XML transformation and XML variable substitution is useless.
Based on the build log, the web app build with release configuration, but there isn’t web.release.config, so there isn’t update for web.config.
You can refer to these steps to achieve your requirement:
Publish/deploy the web app with File System way (e.g. /p:WebPublishMethod=FileSystem /p:publishUrl= $(build.artifactstagingdirectory)\)
Add Copy file step copy others config files (web.dev.config, web.prod.config etc) to the published folder (artifact directory)
Add Publish Build Artifacts
For release, uncheck Publish using Web Deploy option and specify $(System.DefaultWorkingDirectory) to Package or folder.

Cannot connect to mysql from visual studio 2015

So I have already spent about 2 days trying fix this. I have succeeded in fixing this on my workplace pc and can't get it to work on my home pc. I have read about a dozen SO articles and oracle forums articles and whatnot but still it does not work.
I have 1.2.4 msql for visual studio which is supposed to be a release which works on vs2015. I have installed mysql connector 6.8.6 and have first tried to add mysql to my project via nuget but after not being able to find a 6.8.6 version (there are 6.8.3 and 6.9.7 for one package and then again something else for the other...) I have referenced to my C:\Program Files (x86)\MySQL\MySQL Connector Net 6.8.6\Assemblies\v4.5 and have taken the 4 files there and have copied them ove the whole fkin computer. I have pasted it like everywhere. The vs2013 private assembly, my packages folder which I do not even reference to anyway and I think some vs2015 folder. I have ran a search for Mysql.Data and have pasted these files in every folder that came up as a result. I have rebuilt the solution for about 100-200 times and have cried for at least 20 minutes.
What do I have to do to get my new ADO.Net Entity Data Model generated?
I keep getting this stupid
image and I have really absolutely no idea what to do next. I just want to code but every time I start doing something I keep wasting days on tools not working. Do I really have to code in notepad so that I am sure it's my fault that something isn't working?
This is my app.Config file. I do not have anything else in my project.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v12.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<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.8.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.8.6.0" newVersion="6.8.6.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
<add name="KPlusConnectionString" connectionString="server=dito.ninja;user id=xxx;password=xxx;database=xxx" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
</configuration>
In order for VS 2015 to connect to MySql you need to be using a later version of the MySql libraries. While that seems like a pretty simple answer, in all honesty I have run into several problems along the way. With that in mind I am going to write out the 1 process that has consistently worked for me as far as getting EF working with MySql and VS2015. So, without further ado, here are the steps I have been taking in order to get this to work.
1) Make sure the MySql connector installation is updated
2) Create your web project
3) Open Nuget
4) Install Entity Framework
5) Search for MySql
6) Install MySql.Data
7) Install MySql.Data.Entity
8) Install MySql.Data.Entities
9) Install MySql.Web
10) Go to the references for the project and delete MySql.Data.Entity.EF6
11) Check the versions of the MySql.Data and MySql.Web libraries. If they are under 6.9.6 delete them as well
12) Add a new reference by browsing to the install location for the mysql connector for your version of the .NET framework (mine is C:\Program Files (x86)\MySQL\Connector.NET 6.9\Assemblies\v4.5) and grabbing the MySql.Data.Entity.EF6.dll (my version is 6.9.6, keep that in mind when we change the web.config later)
13) If the other libraries were also older versions, add references to them by browsing to the packages folder in your solution and grabbing the files from their respective folders. I do not normally have to do this.
14) Now the Web.config will need to be edited. The first step is to replace the entity framework section with this code (change the version number to your current version. Please note that I found this snippet on the web a couple weeks ago and do not have the original link. I apologize to the original poster of this information.)
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</providers>
</entityFramework>
15) Make sure your DbProviderFactories section matches
<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.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
16) Save and build
I am not sure how many of these steps are actually required but after finally getting it once I had to actually get some work done and didn’t have time to narrow things down further. Hopefully that gets you moving.
P.S. If after all of that you go through the wizard and it just disappears before it shows you the tables in the database to create entities from then it could be one of three problems I have run into along the way. The database server cannot be contacted. The user does not have the needed permissions on the database. The wrong version of MySql.Data.Entity.EF6 was added as a reference or the version number is wrong in the web.config. If I grab this file from the packages directory of my solution I often run into this aborted-wizard-with-no-error-message problem. Grabbing it from the MySql install directory has worked fine for me every time.
It works for me.
I have Visual Studio 2015, and just installed latest version of connector:
http://dev.mysql.com/downloads/windows/visualstudio/
Read this more carefully:
http://dev.mysql.com/doc/relnotes/mysql-for-visual-studio/en/visual-studio-news-1-2-4.html
They mention that version of "Microsoft ASP.NET MVC" could be a problem.
Wrong is that they say VS2015 ships with version 5, but I have version 4 installed with VS2015 Enterprise final.
Tried this and it didn't work for me. What eventually worked was making sure I had the right driver. I run a 64bit Windows 7 computer. I eventually had to install the 32bit version of the MySQL ODBC connector/driver and used the following connection string "Provider=MSDASQL; Driver={MySQL ODBC 5.3 ANSI Driver}; Server=localhost; Database=xxxx; User=xxxx; password=xxxx; Option=3;" and that solved it. tested it on a new project without making all the above changes, and it worked just fine. This post was super helpful in explaining this: https://support.microsoft.com/en-us/kb/942976. Hope this saves someone a lot of time
install the package from this site. http://dev.mysql.com/downloads/windows/visualstudio/ in the Development release tab.
I stopped Visual Studio.. I installed. WAITED.. Seams to take for ever. Visual studio will be running in the background.
Wait till completed.
reopen Visual Studio. boom back in play!
Good luck !
For VS2015 I removed all version installed and through the MySql Installer - Community. I selected Customize Installation and selected MySQL Connectors to install: 1. MySql for Visual Studio 2) MySQl ConnectorNet.
I added references: MySql.Data y MySql.Data.Entity.EF5 both in
C:\Program Files (x86)\MySQL\Connector.NET 6.9\Assemblies\v4.5\
Recompiled the project And When creating de ADO.Net Object the famous MySql data provider was shown!
A warning was displayed about Entity Frame Versions, I just clicked Next And worked![enter image description here][1]

code first -The provider did not return a ProviderManifestToken string

I wrote a windows form solution with 2 layers; one is DataAccess and the other is windows form.
I use Code first. If DataAccess Layer runs in the application console, there is no problem with the db. Create the schema and insert the data.
However, when I run the solution with Windows Form as the initial project and refer to DataAccess as a dll, I cannot build the database. It throws an exception.
I think that the app.config file is the problem, but if I copy the app.config file of DataAccess project to the windows form, it does not resolve the problem.
the config file of DataAcces layer:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
the exception:
"first exception for 'System.Data.Entity.Core.ProviderIncompatibleException' in EntityFramework.dll
Aditional Information: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct."
Inner Exception:
{"The provider did not return a ProviderManifestToken string."}
The problem could be due to Error in connection string
or in my case it was that
SQL server service was not running
manually start the SQL service through SQL SERVER COnfiguration Manager
after a long deep search, i found that solution was "clean the solution".