Primary reference could not be resolved?? (VB.NET) - mysql

I am trying to connect vb.net 2010 to an SQL database using the MySQL DLL file, however whenever I compile it I am getting the following error:
Warning 1 The primary reference "MySql.Data" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". SQL
I have tried it on my desktop as well (also running vb 2010 on windows 8.1) however it won't compile, however on a windows 7 PC it compiles with no issue, despite the fact that the settings appear to be the same.
Any ideas?

Unload the modeling project by right clicking on it in Solution
Explorer window and choosing Unload Project.
Then right click and click edit projectname.modelproj.
Then add following code to it.
<PropertyGroup>
<ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>true</ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch>
</PropertyGroup>

Change in your project properties the target framework version to 4.5
or add a reference with lower version to match your own version (3.5, 4.0)

Related

Visual Studio 2015 not installing Mysql.data in NuGet

UWP App not being able to work with MySql
I have made an app in UWP and instead of using SQLLite which seems to be the norm for Visual Studio 2015 I want to use MySql. I have already connected my Azure mysql database to Visual Studio via the 'Server Explorer'.
I'm using MySQL Workbench to update my tables within my connected database from Azure but I cannot actually write any code to access my tables as whenever I try to install MySql.data/.entity/etc in the NuGet Package Manager I get an error.
nuget error
I tried downloading the Mysql installer, the Mysql drivers for Ado and ODBC. I even tried downloading the MySql for Visual Studio option as I found out that Visual Studio is not compatibile with MySql and instead requires the MySql for Visual Studio download but I still have errors whenever I try to use MySql in my code as I need an assembly reference for it but I'm having no luck in being able to get one that doesn't error.
Does anybody have any idea how I could actually use MySql within Visual Studio 2015?
This is what I've been using as my guideline but I can't seem to get past the Mysql.data errors when installing.
http://web3.codeproject.com/Articles/1074242/Designig-your-Azure-MySQL-DB-with-a-UWP-Demo
I have seen a lot of people talk about this but there is no one straightforward fix (I've tried a lot of the fixes, one in particular being to use Vs13 to install Mysql in the Nuget package manager and then it should update within VS15 but as my app is a UWP VS13 does not actually load/read it so that idea isn't good to me, might help anyone else though)
Starting with 6.7, Connector/Net fully supports building Windows Store apps. But using Connector/Net RT is not by install the Nuget package, it just reference the MySql.Data.RT.dll assembly according to MySQL Connector/Net Developer Guide:
Using Connector/Net RT is easy. Simply create a Windows Store application using Visual Studio and then reference the MySql.Data.RT.dll assembly in your project. The code you write should be exactly the same as for normal Connector/Net (including using same namespace MySql.Data.MySqlClient) except for the differences listed above.
You may find this dll at C:\Program Files (x86)\MySQL\Connector.NET 6.79\Assemblies\RT if you have install the connector. You can also download the mysql-connector-net-6.7.9-noinstall.zip to find this file inside the folder. I also have a MySql UWP sample before and has the dll here. Right click your project and add reference for this it will work.
More details please reference this sample

asp.net core 1. how change the Target Runtime to x86

i develop an Asp core web application (.net framework).
how i specify a run as 32-bit applications?
the publish wizard do not give way to change the Target Runtime, which the selected option is x64 is selected.
I installed on my machine the x86 version of .NET Core Installer.
publish wizard screenshot:
PS Why do I need x86.
I had to run the site on a computer that installed Microsoft Access 32-bit (2003, for an old software).
I also need to access data in Microsoft Access file, which requires me to use the Microsoft.Jet.OLEDB.4.0 driver.
The problem is, probably, that the app's core ASP.NET always running as 64-bit applications, is what gives me the known exception 'driver not registred'
stil after set "enable 32-bit application" in IIS.
i cant install the 64-bit access driver engine, because it requires the removal of MS Access 32-bit...
As mentioned here you need to add the "runtimes" key to your project.json file like below image.
Once you do this, the Target Runtime entry in Publish menu will list all of your specified runtimes. Although this is not enough to get it working since using the Publish menu and selecting x86 version will have no effect and will result in x64 binary files. (This bug may be fixed in future).
The workaround is to navigate to your project folder where the project.json resides. Open a command prompt and type the following to have your binary in desired runtime:
dotnet publish --runtime win7-x86
If you get any error yet, you may need to have the corresponding runtime installed (Download form here).
More info:
https://learn.microsoft.com/en-us/dotnet/articles/core/app-types
https://learn.microsoft.com/en-us/dotnet/articles/core/rid-catalog#what-are-rids
There is also a platform key under buildOptions listing all possible targets, but yet because of some issues (like #1624) it has no effect and it seems the system ignores that.

Xamarin studio 5.7 won't run after installation

I installed the Xamarin studio for windows which is a bundle of MonoDevelop and GTK#. I double click and nothing happens.
First thing, this is the log from the IDE.
Second thing, Bug 10558 Is the same problem but unfortunately post dates back to 2013 which about version 4.0. The fix they mentioned which is updated MonoDevelop.Core.dll file did not work.
3rd thing, GTK# bin directory is added to the environment variable, a couple of posts on the internet says that something wrong with "Win32 DLL search path", unfortunately no steps to help.
4th thing, I tried Xamarin universal installer but I press continue and nothing happens.
Update: I have Windows 7 Professional 64-bit with .NET Framework 4.0 installed.
Update 2: It used to work with me before. I don't know what has changed after I formatted my PC few months ago. I found this link on Bug 10558 which might be helpful but I did not understand it. Also found this patch which I didn't know how to apply it.
Any help is appreciated.
The exception you meet, is a typical one when running binaries compiled against .NET 4.5 on a .NET 4.0 only system.
Microsoft did move some key types between assemblies, which led to such exceptions, and there is no way to fix that except upgrading your system to .NET 4.5.
For Xamarin/Mono guys, they should modify the installer to inform end users about this change. They should also update web pages, such as this MonoDevelop page, which still says 4.0 is enough (no, 4.5 is required),
http://www.monodevelop.com/download/

vb Could not load file or assembly Mysql

I made application in vb 2010. And everything works great at mine computer. I made release and publish the application when i sen!
Pictures
Could not load file or assembly Mysql...
Also is there any way i can put net framework 4.5 to be installed with my application ?
You can include NET Framework by the following way. At least in Visual Basic 2010...
Through Project Tab you open Project properties.
Then in Publish Tab you Click Prerequisites Button.
There you can select the things you want to diistribute and the way they will be distributed.

How do I set ISAPI/CGI option in Windows 7 Home Premium?

This article explains how to correct an exception that's often seen when switching an ASP.NET application to .NET 4.0. However, I don't have this option in IIS when using Windows 7 Home Premium. Does this mean the option isn't there at all, or is it just not visible? If it doesn't exist in the GUI, is this being set in the Windows Registry somewhere? I want to be able to correct this exception without upgrading Windows. Is this even possible?
Issue:
Problem in running .net framework 4.0 website on iis 7.0
Fix (see Windows 7):
http://www.iis.net/ConfigReference/system.webServer/security/isapiCgiRestriction
... see this screen shot (in Fix page)
http://i1.iis.net/resources/images/configreference/isapiCgiRestriction_howto_63.png?cdn_id=20120424-001
Had to click on the server name in the tree hierarchy, not the site name. Then the option appeared.