Visual Basic .Net Application Deployment - vb.net

I have designed an Application tracking details and I have deployed it. The records are updating the way I need. I want the same application to be used in other three different systems which do not have MS Visual Studio. How can I do it ? Is it enough that I create a similar table in the path I have designed in the other systems and run the Application ?

The probably easiest way to deploy your project would be:
Copy & Paste the whole output from your bin folder to the other machine and make sure the .net framework you used for your application is installed on this machine.
You can also create a Setup and Deployment Project
Open the Solution of your application
File -> Add -> New Project...
Other Project Types -> Setup and Deployment -> Visual Studio Installer -> Setup Project
In the File System Tab right-click on "Application Folder" -> Add -> Project Output and Select "Primary output" from your application project.
(More details about adding files to your setup project: How to: Add Items to a Deployment Project)
If you want to use a copy of the access database on each machine
As you're using an access database. You can mark the include you're access database to your project and set Build Action (in the Property Page) to Content.
Now in the same manner as before rightclick on "Application Folder" and add project output. Only this time select "Content Files" instead of "Primary Output"
Build the setup project and distribute the setup.exe or the .msi file.
If you want to access the same database from each machine
I would advise to store the application on a server which runs independent of your machine so that others can access the database also when your machine is not running.
Change your connectionstring, so that users from other machines are able to connect have a look at this site if you need help with connectionstrings.
As you won't be able to connect to the database with the absolute filepath from other machines, create a fileshare where everyone who should be able to connect has permissions to read/write.
Build the setup project and distribute the setup.exe or the .msi file.
Hope this helps so far.

Why should there be VB language on the target computer? Once compiled(published) you are out of the language environment and the program is in the machine language. In order to publish you have to go to "Build" and "Publish" after opening the program in the language environment. Publish it to a flash drive instead of the C drive. You can do that by selecting the "Browse" option. Once done you can take the flash drive around and install it on most computers that have the .Net files installed. In my experience most windows opss have them.

Just create an Installer after you have written and debugged your program. Install it plus your database on the server computer. If you intend to share the database and its a file-server database such as Ms Access, you will have to make sure that the folder is a shared folder.
Go to all the other computers on the network and repeat your installation. Make a Mapped drive on each computer and configure your database string to point to the mapped drive. If your database a server one like SQL Server, you will need to configure your database access string to point to the Server like so:
\Syl-PC\SQLEXpress.MydatabaseName
I assume that you are familiar with the complete syntax for connecting to databases from Visual Basic using a database provider such as Ole db or the SQL Server Provider.

Related

Visual Studio installer extension output

I am using Microsoft Visual Studio Installer Projects to make a setup file for my C# app and when I install my app it says:
Failed to update database because the database is read-only
Here is screenshot of my database in Microsoft SQL Management Studio that shows read-only is false.
Here is screenshot of my database file in installer that shows read-only is false.
Yet after installing my app I get error above.
Any idea?
Solved
While comments above were helpful but easiest solution for me that didn't require lots of editing and coding was to change Application Folder path to outside of Program Files (86) folder something like this
C:\[Manufacturer]\[ProductName]
Here is screenshot of where to change that path and everything works fine now
Now it will install on path like C:\My_Company\App_Name where there is no permission restrict for system to access database file.

Filepath for database in application

I have a SQL database on the server and I want to import it to Visual Studio. I executed the script and a copy of the database was created in VS. Now what I want is to include the Database in to the project folder and I want to know the path of the Database relative to the application.
Also what should I do so that the installation file includes the database as well.
I am working in .NET WPF

the application requires that assembly microsoft.reportviewer.processingObjectModel version 11.0.0.0 be installed in the global assembly cache first

I have a small windows forms application created in Visual Studio 2012 that uses ReportViewer version 11.0.0.0.
The application target framework is .NET 4.0 and its deployment method is ClickOnce
On my PC it installs but on client machines, intallation fails with error
the application requires that assembly microsoft.reportviewer.processingObjectModel version 11.0.0.0 be installed in the global assembly cache first.
On the client machines, i have installed
.NET 4.0
ReportViewer 2010
Microsoft Report Viewer 2012 Runtime CTP
SQLSYSCLRTYPES.msi
in the project application files settings, i have set microsoft.reportviewer.processingObjectModel publish status to Include(Auto), in the references i have also set its Copy Local property to True.
what am i missing?
I have even followed the instructions here http://msdn.microsoft.com/en-us/library/ms251723.aspx
Here is (arguably) the best way to deal with this issue... without downloading or installing any extras. This worked with Visual Studio 2012 (Ultimate)
Goto the main project within your solution(default/statup project)
Right Click and Click Properties / Select "Your Project">> Project>> Properties
Click on "Publish" Tab to see publishing options
Goto "Install Mode and Settings">> Click "Application Files" and Dialog opens
Go down and look for the items set with "Publish Status" > Prerequisite
You will find ReportViewer and Several Other Files set to Prerequisite
Change all the Publish Statuses to "Include" in the drop down
I know you only need the ReportViewer Only but this will eliminate other potential problems I came across
Now all the required files will be added to your installation setup good to go!
For interest, you can change include a desktop icon under "Install Mode and Settings">>Options>Mainfests>Create Desktop Short Cut
you are missing the ProcessingObjectModel.dll file find the version 11.0.0.0 in gac assembly C:\windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel and add it to bin dir.
We had the same issue, but the thing is, its automatically adding it to the references (microsoft.reportviewer.processingObjectModel), if u EXCLUDE it from the publishing properties(properties->publish->application files), It might fix it.
A better option would be to install the Microsoft Report Viewer 2010 SP1 Redistributable Package at:
http://www.microsoft.com/en-us/download/details.aspx?id=6610
Your users will need to have this package installed as well. If you just copy and paste a MS DLL, you'll have to redeploy it every time you upgrade your application.
If you are using WinForms, to me it seems pointless to worry about installing this DLL in the GAC when it's being used for a report viewer that is deployed via click-once. This isn't a big file and you're probably using it as a report viewer control on a form, nothing more. One possible solution is to do the following:
In Visual Studio, go to the reference in your project for the assembly Microsoft.ReportViewer.ProcessingObjectModeland locate the file path to the folder for that assembly. Mine was version 12 and so my file path was C:\windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel\12.0.0.0__89845dcd8080cc91
Copy the file path of the folder the assembly is in and remove the reference from your project (right click the reference and select "Remove").
Win + R to get a 'Run' prompt. Paste that folder path in there and execute to jump right into the folder of that DLL.
Find the DLL, it should be the only file in that folder, and copy it to your Visual Studio project folder. You shouldn't care about 100kb of extra space on your drive consumed, and I don't think this DLL is one you'll need to update.
Back in Visual Studio, right click References, Add Reference, and browse for that DLL in your project folder. After adding the reference, make sure that the Copy Local property is set to true.
Clean and rebuild, test the application on your local computer, than Deploy your ClickOnce again.
Now when users install your application with ClickOnce, the reference will not refer to the GAC at all and there won't be any need to rely on the prerequisite check/installation process for this DLL because you have included it directly in your published application.
It depends on the setup type you are using but basically, it means the required library is missing from your server or computer. To enable the application to download from the server (In a client-server architecture), you need to include the file(s) in the project.
Go to your application option and locate the "Publish" tab
Click on "Application files"
In the ensuing dialog, select to include all the libraries you want included (or that are required to run your application on the client machine and click "Ok")
Build your application and then publish to the server.
I hope this works for you, it worked for me in Visual Studio 2010 Professional
In case of Windows 10 it won't work installing Microsoft Report Viewer 2010 SP1 as describe by user1236560. First you need to install Prerequisites for SQL Server Management Objects (SQLSysClrTypes.msi) need to choose between x86 and x64 depending on your hardware. You could find it on: http://origin.www.ms.akadns.net/downloads/en/details.aspx?FamilyID=16BC778C-357B-46E9-8356-D575903AC831
After that you need to install MICROSOFT® REPORT VIEWER 2012 RUNTIME that you could find on: https://www.microsoft.com/en-us/download/details.aspx?id=35747
Both of this package will have to be installed.
I encountered this error
System Update Required
Unable to install or run the application. The application requires that assembly
Microsoft.ReportViewer.ProcessingObjectModel Version 11.0.0.0 be installed in the Global Assembly Cache (GAC) first.
Please contact your system administrator.
this error popped out when installing an application made from Visual Studio
meaning I am one of the client
I have Visual Studio 2015 and a Microsoft SQL Server 2014 and didn't know about Crystal Reports and other related stuff to it. I do check the version of my .NET Framework which is version 4.6.2.
I have several extension files and distributable files downloaded and yet doesn't solve my problem.
I do not know if I solve the problem generally but I do become successful in installing the application
so I downloaded and installed the ff:
SAP Crystal Report for Visual Studio 2015(latest, just to make sure)
Microsoft System CLR Types for Microsoft SQL Server 2012
Microsoft Report Viewer 2012 Runtime.
the problem took me about 2 days to trouble shoot, Be careful on downloading and installing extension files and distributed files cause it will munch some space too.
The Best answer is:
Here is (arguably) the best way to deal with this issue... without downloading or installing any extras. This worked with Visual Studio 2012 (Ultimate)
Go to the main project within your solution(default/statup project)
Right Click and Click Properties / Select "Your Project">> Project>> Properties
Click on "Publish" Tab to see publishing options
Go to "Install Mode and Settings">> Click "Application Files" and Dialog opens
Go down and look for the items set with "Publish Status" > Prerequisite
You will find ReportViewer and Several Other Files set to Prerequisite
Change all the Publish Statuses to "Include" in the drop down.
I know you only need the ReportViewer Only but this will eliminate other potential problems I came across
Now all the required files will be added to your installation setup good to go!
For interest, you can change include a desktop icon under "Install Mode and Settings">>Options>Mainfests>Create Desktop Short Cut
It reduced all of my head aches.

How to deploy custom files on remote PC via Visual Studio Remote Debugger 2012

Debugging on Remote PC can be tricky if you need to deploy many files on that PC.
First of all you need to configure PC, i.e. share folders, configure security to easily copy files from your to test PC.
Then you need a deploy script to actualy copy files. And you need somehow to send target PC ip to it.
In Visual Studio 2012 there is Deploy step then studio can deploy your project's files onto remote PC, but it seems it is only working with "easy" cases then no need to copy files on different folders or rename it to start debugging.
It seems that new Remote Debugger has new hidden api to copy files. But it is unavailable from outside of Visual Studio.
If there is a way to use Visual Studio Deploy function to implement "One click Deploy/Debug" procedure?
The answer to the question is somewhat dependent on the type of project you want to deploy. For example, in the C++ project system under Project Properties->Configuration Properties->Debugging->Remote Windows Debugger you can specify a Deployment Directory and Additional Files to Deploy.
If you want to implement your own deployment system, then the answer is yes, you could write a Visual Studio extension, use the deployment API to both copy files and execute anything you required such as a configuration script on the remote machine.

Visual Studio 2010 Database Project Installer / Install script

I have been using a database project in visual studio 2010 to create a database. Visual Studio makes this process really easy to deploy the database and deploy updates. The issue I have is how I can get visual studio to create a script that will build the database that I can use on a QA or production system.
I thought that building the project would create a SQL file that did this but this does not seem to be true. Can someone please advise on how I can do this or what simple step I am clearly missing.
As strange as it may sound, Visual Studio does not create a SQL file to deploy your database when you perform a Build.
Instead, this occurs at Deploy time. The reason behind this lies in the way that Visual Studio makes changes to the database that you're deploying to: in order to change your database, it must first compare the project model (as defined in the files contained within the .dbproj) with that of the existing database schema to determine what changes you have made since the database was last deployed.
You then have the choice of manually executing the SQL script produced using the SQLCMD command-line utility (or through SSMS in SQLCMD mode), or alternately you can configure your Visual Studio Database Project to execute the script if you specify the following Deploy Action in project settings:
Generate a deploy script (.sql) and deploy to the database
Note that you will need to provide a connection string in project settings so VS knows where to deploy to.
When you get to the stage where you want to deploy to a QA or PROD environment, you have a couple of options:
Deploy directly within Visual Studio. In addition to the standard Debug and Release configurations that you get when you first create your Database Project, you can also create your own configurations which you could use to deploy to your QA and PROD environments (i.e. potentially with a different connection string/target database name).
Deploy from a Build Server. Install Visual Studio on a separate machine and call MsBuild against your .dbproj/.sln file with the Build and Deploy targets specified along with the appropriate connection properties.
Doug Rathbone has written a great blog post on subject if you want to learn more:
http://www.diaryofaninja.com/blog/2011/06/23/compare-amp-update-database-schemas-right-within-your-ide--part-2-automation-with-teamcity