How to install windows application and SQL server on the client machine? - c#

I want to install my c# windows application on a client place which does not have .NET framework or SQL server. What files do I need to install in order for the application to work with database and how to create a package?

Create a setup project from Visual Studio and specify in the prerequisitesto include .NET framework and SQL Server Express. these packages will then be included in the setup or I think you can also specify to download automatically on setup execution.

You can use ClickOnce deployment for this. With ClickOnce you will give the client an install package that can check for prerequisites and install them if neccesarry. The .NET framework and SqlServer express can be installed this way.
Check the following link for more info: ClickOnce

Related

Authentication method 'caching_sha2_password' not supported by any of the available plugins

When I try to connect MySQL (8.0) database with Visual Studio 2018 I get this error message
"Authentication method 'caching_sha2_password' not supported by any of the available plugins"
Also I am unable to retrieve Database name.
I use mysql-for-visualstudio-1.2.7 and mysql-connector-net-8.0.11 for connection.
Is there any possible way to fix it.
1st
Modify the MySql Server:
Open MySQL Installer - Community
Select Product MySQL Server
Click on Quick configure in last column
Click on next untill you will not point to Authentication method
On Authentication method tab- select Use Legacy Authentication method
Click on next and finish
Now you can login with normal password
2nd
If you are using .net framework 4.5.2
you can easy upgrade reference of MySQL.Data:
Visulastudio> Tools> Nuget Package Manager>Manage nuget package for solution
Go to Browse tab, Write Search textbox mysql and enter
first mysql.data package will come, install it
Now login, issue will resolved
This is a new authentication method used in MySQL version 8.0 as compared to mysql_native_password, which is the legacy method. In order to make this work, you will need to upgrade your MySQL Client library to version 8.0.
So, use the following link and get the version 8.0.11 or higher.
https://dev.mysql.com/downloads/connector/net/
I had the same issue. Fixed it by removing the reference to MySQL.Data then re-adding it.
Update the Pomelo.EntityFrameworkCore.MySql Nuget Package to 2.0.0.1 instead of 2.0.0
2.0.0.1 is more stable than 2.0.0 and 2.0.1
Just update your nuget package for MySql.Data
Our old .NET Framework 4.6.2 project began throwing this exception, when someone came back to using it after we updated MySQL server version few months ago.
So at first, as others recommend, I updated all packages via NuGet Package Manager (including MySql.Data to v8.0.24) - didn't seem to help at first. Then in project properties updated project target framework to .NET Framework 4.7.2 - still nothing.
Then I noticed the connection string had this providerName parameter:
<connectionStrings>
<add name="___" providerName="MySql.Data.MySqlClient" connectionString="server=___;user id=___;password=___;database=___;"/>
</connectionStrings>
so I tried removing the .MySqlClient part from it, leaving it
providerName="MySql.Data"
and for some reason it worked:) Maybe updating the MySql.Data package was part of the solution and the .MySqlClient is some obsolete property. No idea.
Do you hardly need the authentication method in MySQL to be 'caching_sha2_password'? If not, why don't you just switch it to 'Standard'?
You can check this in the "User and Privileges" settings and look for the Authentication Type.
I faced the same error while i was trying to connect my client machine to the Server. I had to connect to MySQL server hosted on the Server. I have got this to working. Followed the following steps:
Download the latest MySQL community version i.e 8.0.18.0 installed. Make sure that the same version of MySQL is installed in the server machine. Please note that either the same version of MySQL are installed in client machine and server machine or else client machine should have higher version of MySQL installed.
With the help of MySQL installer make sure that you installed 'Developer' version in your client machine, so as to have MySQL server, SQL.net, mySQL for visual studio e.t.c all will get installed in it.
We are using .Net framework 4.5.2 in latest MySQL community. So, make sure you using Visual studio 2019. Build UiConfigEDItor source code in Visual Studio 2019 so that it will have support for higher version .Net framework 4.5.
Now, copy all files (mysqlData.dll in particular) from SQL installed workspace(C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2) to Visual Studio 2019 workpace (C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE).
Log off you machine and now open UIConfigEditor source code in visual studio 2019.
Now in Solution Explore->References->Add References->Go to Assemblies tsb-> Extensions->Search for mysql.data.dll(make sure that its there)->check that option.
Please note that mysql.data.dll is of version 8.0.18.0 in this case.
Sometimes, it has a silly reason. In my case, I forgot to create my database in MySQL. Sometimes, one my forgot to run database daemon.
Not every scary error message is because of a scary situation.

Can .mdf use as embedded database?

I am new to C# and SQL Server databases, so this may be a stupid question but I am confused.
I want to setup an embedded database on a client machine automatically when he installs my application. I know SQL Server Compact Edition is there but there are so many restrictions in SQL Server CE.
Can I use .mdf files as an embedded database? If yes then how can I setup it on client machine automatically? or is there any other option to solve my problem?
I would recommended to use SQLite. It is simpler to deploy. Also, SQL Server Compact appears to be discontinued.
Is SQL Server Compact discontinued from Visual Studio 2013?
You can use SQLite which doesn't require any installation on the client machine.
SQLite depends on the Visual C++ runtime, but you don't need to install it on the client machine. The system.data.sqlite download page contains several "static" packages that already contain the runtime.
All the "static" packages contain either native or mixed-mode assembly
binaries linked statically to the appropriate version of the Visual
C++ runtime. Typically, these packages are used in cases where
customer machines may not have the necessary version of the Visual C++
runtime installed and it cannot be installed due to limited
privileges.
For example, on my machine I am running Windows 8.1 x64 so I went under Precompiled Statically-Linked Binaries for 64-bit Windows (.NET Framework 4.0) and downloaded sqlite-netFx40-static-binary-x64-2010-1.0.90.0.zip.
This binary package contains all the binaries for the x64 version of
the System.Data.SQLite 1.0.90.0 (3.8.2) package. The Visual C++ 2010
SP1 runtime for x64 is statically linked. The .NET Framework 4.0 is
required.
I then unzipped the package and ran test.exe to make sure everything works. Zero installation required.

Run additional EXE from 2012 InstallShield

I have created an installshield project using the Limited edition 2012 of InstallShield.
My application uses the Microsoft Agent 2.0 control in some places. So my question would be :
How do i run the Agent installer from my install wizard? Either before the main app is installed or after...
Also, i have set a prerequisite on the setup project to include .NET 4.5 and the installer to require .NET 4.5...but if i uninstall .NET and run my setup, it simply says i need the .NET Framework, rather than installing it...any ideas?
Add a prerequisite installer for agent. And keep the one for.net, it shouldn't install if it is already present. If you don't need .net then look for a install condition that is requiring it.

Deployment of Entity Framework application using SQL server 2012

I made an wpf application on .Net Framework 4.0. It is using entity framework and SQL server 2012 as a database.
Now I want to deploy this machine on another computer. What needs to be installed on that machine. I am assuming that fresh OS has been installed on target machine.
I've already deployed the same application with install shield, here's the list of all needed deps (downloadable for free from microsoft website) from WinXP SP2 to Win8 and works on both x84 | x64
The no need for entity Framework its already in .netFX 4.0
you can also specify the sqlserver configuration parameters using
SQLEXPR_x86_ENU /ACTION=Install /FEATURES=SQLENGINE /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /AGTSVCACCOUNT="NT AUTHORITY\LOCAL Service" /SQLSVCSTARTUPTYPE=Automatic /BROWSERSVCSTARTUPTYPE=Automatic /TCPENABLED=1 /NPENABLED=1 /ADDCURRENTUSERASSQLADMIN
It depends on how you plan to deploy really. Generally, you'll need a copy of SQL Server (full or express edition depending on budget / whether the limitations of express are a problem for your situation).
You will also need to install the .NET framework and any other dependencies (depending of your app). You could use Visual Studio to create an installer, then it will bundle all of the dependencies and make the installation on other machines nice and easy.

Adding .Net framework updates to a setup project

I have a setup project which, as a prerequisite, requires the .Net 4 framework installed locally on the target machine. I specify the install location for prerequisites as "download prerequistes from the same location as my application" resulting in the dotNetFx40_Full_x86_x64.exe being added to the installer (since the target machines we install to are not connect to a network, i.e. standalone).
I'd also like the installer to recognise it needs to install any updates of the .Net 4 framework to the standalone target machine if required. What is the best way to accomplish this?
Thanks in advance.
If you know what updates are required, the simplest way to do it is probably just to create new bootstrapper packages for the standalone updates, and add them as additional prerequisites. There's more info on that here:
http://msdn.microsoft.com/en-us/library/ms165429.aspx

Categories

Resources