How to make my project runnable on any system? - c#

I have developed a solution in Visual Studio 2008 C# WPF!
I'm using a service-base SQL database (I've created and managed using Microsoft Visual Studio Sever Explorer), now I'm going to publish it but the problem is that when I install .NET Framework 4.0 and SQLEXPRESS 2005 on other systems, my application doesn't launch! :-(
What componenets should I install on the systems to make it runnable?

If you develop with Visual Studio 2008 you will probably need to install .NET Framework 3.5 with Service Pack 1.
If that is not enough you need to post the error you get. Probably in the eventviewer you will see more info.
You can try to create a setup using Clickonce. To do this you need to go to the property pages of the WPF project an go to the tab Publish.
There you can choose to publish it to the network or to a local directory which can be put on a CD or USB device. The most important thing for you to check is the button "Prerequisites".
I hope this helps!
EDIT to help with the comments:
It is perfectly possible to put the prerequisites in the same folder as the install or even better in a fixed network location as you can see in this screenshot below

Related

The components for communicating with FTP servers are not installed

I have a WPF C# app (.Net Framework 4.5) which I regularly updated and published to an FTP server using ClickOnce (every few months). Now, when I want to publish it to the FTP server, it fails with the following error message: The components for communicating with FTP servers are not installed.
Searching the web and StackOverflow, I read that in some cases Xamarin prevents publishing it, so I uninstalled Xamarin (as advised), but the problem persists. I also tried to publish locally and then manually copy the files to the FTP server, but then Windows Defender blocks the installation for the user. I also updated Visual Studio Enterprise to the latest version (Update 2).
It seems this issue has been there for quite a long time (one, two, three). Does anyone have an idea how to solve the issue, or what else I could try?
kurtdv on MSDN suggested to install the 32-bit version of Visual C++ Redistributable Packages for Visual Studio 2013 from https://www.microsoft.com/en-us/download/details.aspx?id=40784, which solved my problem.

"Reference package not found. Device Connectivity Component" when delopying C# program to Windows Mobile 6.5 device

I'm working on a C# project for windows mobile 6.5 and as of this morning I'm getting "Reference package not found. Device Connectivity Component" whenever I try to deploy.
It builds without errors and was working up until today. I did a bit of looking around and only found dead ends online. As far as I can see there are no clues about that component or package this is a reference to. I think it may be related to Windows CE SQL Compact but that's based on nothing. I've rolled back to an earlier version of my code and cleaned a few times. I'm stumped.
I would greatly appreciate any help even diagnosing this a bit further. I'm using Visual Studio 2008 3.5 SP1
Update: When I disable "Deploy latest version of the .NET Compact Framework (including Service Packs)" it does deploy but then throws errors related to the SQL database which worked previously. assumedly because it doesn't have access to the correct SQL packages.
Update: I also get the same error with the emulator, it builds, the emulator starts but can't deploy, giving the same error.
Update: I think this might have something to do with it. Note the double slashes in the path. I keep removing them. It keeps coming back.
Update/Correction: I can now deploy to the emulator, I had a problem before but it seems to be ok now. I still can't beploy to the device, same error.
For anyone who was pulling their hair out like me. I couldn't figure out what was wrong although I still suspect it was something to do with the .NET compact package. Eventually I created a new project, set up the references and copied and pasted the code over. It's not a nice solution but it worked after days of being stuck.
HA! I found it! This may not be your solution, but this was how I did it.
See this REF: http://msdn.microsoft.com/en-us/library/aa983326(v=vs.90).aspx
Since Microsoft is bad about deleting their old info, I'm going to post it here, too. But basically, if you select a Private Deployment, then Microsoft Updates will not influence your project or update your 3.5 databases to ...whatever the newest stuff from Microsoft is.
How to: Deploy a SQL Server Compact 3.5 Database with an Application
You have two deployment options for applications that contain SQL Server Compact 3.5 databases. The method of deployment you choose depends on the servicing requirements of your application and whether your users will need administrative credentials on the computer on which the application will be installed.
Following are the deployment options for SQL Server Compact 3.5 databases:
Traditional Microsoft Windows Installer (Microsoft setup technology)
Users need administrative credentials to install the application.
SQL Server Compact 3.5 will be serviced by Microsoft Update.
Can use ClickOnce deployment.
-or-
Private file–based deployment (deploying the SQL Server Compact 3.5 DLLs as part of the project)
Users do not need administrative credentials to install the application.
SQL Server Compact 3.5 will not be serviced by Microsoft Update.
Can also use ClickOnce deployment.
Traditional Windows Installer
Traditional Windows Installer technology is used in both standard Setup and Deployment projects and in ClickOnce deployment. When you deploy a SQL Server Compact 3.5 database, ClickOnce deployment provides an option that automatically installs SQL Server Compact 3.5 if it is not detected on the target computer. For this reason, ClickOnce is the preferred method of deployment for applications that include SQL Server Compact 3.5 databases (as opposed to creating a custom action in a Setup and Deployment project).
ClickOnce deployment has been updated so that it automatically includes the SQL Server Compact 3.5 runtime as a prerequisite for applications that include SQL Server Compact 3.5 databases. It also recognizes .sdf files as data files and sets these to the correct publish status.
Creating a ClickOnce deployment for an application that contains a SQL Server Compact 3.5 database consists of configuring the proper publish information in the Project Designer.
To use Windows Installer technology for ClickOnce deployment of an application that contains a SQL Server Compact 3.5 database
To open the Project Designer, in Solution Explorer/Database Explorer, double-click My Project if you are working on a Visual Basic project (or Properties if you are working on a C# project).
Click the Publish tab.
Click Application Files and set the .sdf file to Data File (Auto). (This setting notifies the installer to treat this as a local data file and to put it in the Data Directory.)
Click Prerequisites and select SQL Server Compact 3.5. (This setting notifies the installer to check whether the SQL Server Compact 3.5 runtime exists and to install it from the Internet if it is not found.)
Creating the Installer After the publish information is configured, create the installer.
To create the installer
In the Publishing Location box, type the Web site, FTP server, or file path to publish the installer to.
Click Publish Now to create the installer.
The application is ready to be installed. Go to the location you published to, and install the application to verify.
Private File-Based Deployment
Private file–based deployment refers to the process of including the required SQL Server Compact 3.5 DLLs as files in the project (as opposed to a reference to DLLs already on the target computer). If you include the necessary DLLs with the application, the requirement to install SQL Server Compact 3.5 is removed. Therefore, the administrative credentials are no longer needed.
You can use ClickOnce deployment technology for private file–based deployment. If you do, you must remember to clear the SQL Server Compact 3.5 prerequisite so that the Setup program does not install it.
To deploy a SQL Server Compact 3.5 database by using private file–based deployment
To open the Project Designer, in Solution Explorer/Database Explorer, double-click My Project if you are working on a Visual Basic project (or Properties if you are working on a C# project).
Click the Publish tab.
Click Prerequisites and then clear the check box for SQL Server Compact 3.5.
Close the Project Designer.
Go to the directory that contains the SQL Server Compact 3.5 DLLs. These are located in C:\Program Files\Microsoft SQL Server Compact Edition\v3.5.
Select the seven SQL Server Compact 3.5 DLLs and copy them:
sqlceca35.dll
sqlcecompact35.dll
sqlceer35EN.dll
sqlceme35.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll
Paste the DLLs into the project in Solution Explorer/Database Explorer.
Select all seven DLLs in Solution Explorer/Database Explorer and open the Properties window.
Set the Copy to Output Directory property to Copy if newer. (This will replace any earlier DLLs in an existing application with the newer ones if the application is updated.)
Click the Show All Files button in Solution Explorer/Database Explorer.
Expand the References node.
Select System.Data.SqlServerCe.
Set the Copy Local property to True. (Because your development computer has the SqlServerCe DLLs in the global assembly cache, you must configure the application to use the DLLs in the output directory.)
Right-click the project in Solution Explorer/Database Explorer and select Publish to open the Publish Wizard.
Complete the wizard to publish the application.
The application is ready to be installed. Go to the location you published to, and install the application to verify.
I had the same problem. I got it to work by closing visual studio, renaming the directory:
C:\Documents and Settings\\Local Settings\Application
Data\Microsoft\CoreCon
Then reopening visual studio and the deploy worked.

deploy wpf app with sql database

I am using Visual Studio Setup and Deployment deploying my wpf app. My aim is to package my wpf app so that I can install and run it in any machines which don't have sql installed and machines don't have internet access. I am using sql server express 2008 r2 and VS2010. I did some research, migration might be the solution but I have no idea how to use it and I don't find helpful tutorials for that. Please help me. Thanks in advance.
You can use Microsoft SQL Server Compact Edition with a private deployment. See this good article
In your setup Project, Go to project properties, Click for prerequisite button and check sql server version you are using for your project, also check the .Net version of the project.
if the host computer don't have the internet than select "specify the install option" as Download the prerequisites form the same location as my application.
This will create a full package of your application and ready to be deployed in any machine.

Lightswitch 2012 and Windows XP

i finally finished a proyect i was requested in my university with Lightswitch. Im ready to deploy (publish) next week, and i was JUST told that the people that will recieve the software, are using XP machines. I've read a lot of questions and lots of fixes, to get Lightswitch working on Windows XP, like:
Changing the DumpBin with "editbin vslshost.exe /SUBSYSTEM:WINDOWS,5.01 /OSVERSION:5.1"
deploy it as a desktop application with the services deployed to IIS (i dont think this will work because those are really old pc's)
install all the prerequisites manually and launch the ClickOnce application directly from deployment manifest file (.application)
create a sample ClickOnce application using Visual Studio 2010 OR Visual Studio 2008 with the same name as mentioned in Visual Studio 2012 and publish it. From the published location take the setup.exe bootstrapper and replace the existing setup.exe bootstrapper created using Visual Studio 2012
With all of this workarounds available, i NEED to ask, will this ultimately work? Can someone REALLY tell me that using one-or-all of this workarounds i WILL be able to deploy the application!?
Someone?
The 2-Tier Deployment issue on XP was also addressed in VS 2012 Update 2 IF you upgrade to a "V3" LightSwitch project by right-clicking on the root project in Solution Explorer and selecting "Upgrade Project". This updates the project to the "V3" project system, runtime and will use a much newer publish wizard. The version of VSLSHOST.exe that ships with VS 2012 Update 2 is compatible with XP.
Dave Kidder - LightSwitch team
http://social.msdn.microsoft.com/profile/dave%20kidder/
I have a successfully deployed application using the 3-tiers running as an out-of-browser (desktop app) on XP. Initially I was going to do the 2-tier deployment, but I was unable to get a workaround to work.
So I have one server, which runs IIS as well as my SQL server (OS is Windows Server 2003, but doesn't have to be.)
The client machines range from Windows XP to Windows 7, and I haven't had any special problems with windows XP.
So I can definitely say XP will work as a client. I was unable to get it to run the middle tier (hence IIS on the server) but I didn't try every last idea I found, so I won't say it's impossible.
The two links I found most helpful in the process were
http://blogs.msdn.com/b/bethmassi/archive/2011/03/23/deployment-guide-how-to-configure-a-web-server-to-host-lightswitch-applications.aspx
and
http://blogs.msdn.com/b/bethmassi/archive/2012/03/29/lightswitch-iis-deployment-enhancements-in-visual-studio-11.aspx
Hope that helps.

Making a setup for C#/SQL app

this is my first post in stackoverflow, I've always checked this site by searching in google, so I decided to join it myself! I hope to be useful to others
I'm a 3d developer (DirectX), but recently I've started making an SMS gateway using C# and SQL Express, now I'm going to create a setup file for my project (which uses .NET 3.5), what are my options? I've heard that VS 2008 can make setup, is there any sample? how can I include SQL express in my setup app?
also I've downloaded Install Shield 2010 which has a built-in support for VS 2008, I want to make my setup in a way that it detects SQL on target system and if it finds SQL already installed, doesn't try to install it again (the same rule can be applied for .NET), what are my options? how can I make such a setup file?
thanks
With Microsoft's Visual Studio, there is an inbuilt Setup Template which you can use.
Click Once
For your scenario you should take a look at Adding Click once Custom Prerequisites.
Setup And Deployment Application
For your scenario you should take a look at the Walk-through.
Or as you mentioned you have InstallSheild 2010 then:
Install Shield Wizard
Take a look at this Walk-through with Limited Edition
As for SQL Server i think you can usually go as far as SQL Server Compact Edition. (For anything greater you may need to Inform User to install it himself)
I have no personal experience with it, but SQL Server 2008 Compact might be good for this. It is an embedded solution so so you don't actually need to install a server. Alternatively you could look at SQLite, which has native .NET implementations (google for "sqlite .net").

Categories