VS 2012 Install Shield Installer SQL Compact - c#

Good evening!
Here is the thing, i've been trying to create a setup project for my app which includes some winforms and a SQL Compact Data Base.
I already added to my VS 2012 the required installation to create install shield installers for my apps, i add it to my project and i follow the instructions.
Once im asked to add the required files to their destination computer paths i add on the install directory the interface final results and to a C:\ folder, the data base final results. I of course changed the database connection to that new folder.
I proceed to generate the installation and then use it on my own computer, everything goes smooth, and once it finishes, i launch the app, it works okay, but upon opening a form which has a datagridview inside of it (or i click a button that has a connection with the database) i get an error messagge telling me that the db files could not be found.
I go to the database folder and it is there, but it doesnt work, the thing is, if i go to my VS 2012 projects folder, open the DataBase project folder and i copy the database inside of it (.sdf file) and i paste it in the new folder for the program, the app works just fine.
Any suggestions? what am i doing wrong?

Related

Renaming file in setup project in visual studio

I have written a WPF/C# desktop application with a standard setup project. When the application is installed, an sqlite database is placed locally on the users file system. Now, I have renamed my app and I want to rename the database as well. I have renamed the database file in the solution explorer (the corresponding file in project folder is automatically renamed) and on the File System tab of the setup project. However, the name of the database under the setup project in the solution explorer is not changed.
I am not sure whether this really matters, Source path and TargetName for the setup project database has the new name and everything seems to work. But i figure it could be confusing for someone else with dirrerent names for the same database, and I worry it could lead to some problem I cant foresee.
Does anyone know how to solve this?
Maybe you can edit it directly from the project file, if i remember correctly its an xml

clickonce update of visual studio not working

I publish my application from project properties of visual studio and i set the update-path to one of my local drivers E:\WebSiteupdate. The update must run before application starts but i do not really know what should i put on E:\WebSiteupdate to update the application.
here what i used to do for update:
another publish from new application
copy all of new publish folder in E:\WebSiteupdate
but nothing happened and still show old program
what kind of files should i put on update path for update application?
Clickonce's auto updates are meant to update installed applications. That has nothing to do with the project run from VS. When you set Update location, each time the app launches it will check for a newer build/publish in that location. If there is a different build, it will automatically update your installed app. To answer your question what kind of files...? Its is the same contents that you get while you publish your app.
To try this:
Set your Upload location(Project properties --> Updates...) to a path accessible from your pc.
Publish your app to a different location lets say D:\Publish\
Install the app in your pc. There should be D:\Publish\setup.exe. Double-clicking that will install. This will put a shortcut menu in the start menu.
Make any minor change in the UI of your project (in VS).
After clearing the contents in D:\Publish do another publish.
Clear the contents from the Update location and copy over the contents from D:\Publish.
Now (don't do another install) close (if already open) and open the app again (shortcut should be present in Start menu)
The app should update automatically before opening. This is how we are expected to give app updates to the clients. Further, if you like to automate this I found the below link by deadlydog very helpful: http://blog.danskingdom.com/continuously-deploy-your-clickonce-application-from-your-build-server/

Where is Visual Studio storing Publish Profiles?

I have a corrupted Publish profile.
I need to delete it. My other computer is fine, so I know it is local.
I have tried:
Clean checkout of codebase from Git (so nothing is local in my code directories).
Deleting C:/Users/<user>/AppData/Local/VisualStudio
Deleting C:/Users/<user>/AppData/Roaming/VisualStudio
Full text search of Profile Name 'MunicipalAgenda' through Registry
Full Text search through machine.
Creation of a new Windows User for Visual Studio Development.
Despite all of this, VS.NET is hanging onto that corrupted Publish profile.
Honestly I am at wits' end, and my next drastic step is to do a fresh reinstall of Windows 10. Please help before it comes to that!!!
Normally any publish profile store in particular project.
For that you have to look at following location.
Go to that project.
Project has special folder call Properties
Inside that there is a folder called PublishProfiles ( Something similar)
I also had some difficulty in getting my profile deletions to stick ... Visual Studio (2017) doesn't seem to be able to do it from Solution Explorer.
My latest attempt is to go to Source Control Explorer, open up the /Properties/PublishProfiles folder, and delete and commit the unwanted profiles from there. So far so good :)

precompiledapp.config - how do I create it?

I'm having a problem with a web application where the events in the global.asax class aren't being executed when I build the application through our build server and publish the website. In Application_Start is a single line of code sets up our logging, and in Application_Error I have some error handling code. Locally it all works fine, and if I copy the files directly from my development folder to the server rather than publishing it via the build server everything works fine.
From loads of Googling it would appear that this is a problem with the precompiledapp.config file being missing - sure enough it doesn't exist anywhere. However, nowhere can I find out how I actually get the TFS Build Server, or Visual Studio (2010), to create this file so that I can publish it.
Any advice on how I can generate this file would be much appreciated.
EDIT: A bit more information. I've just tried publishing the website through Visual Studio 2010 rather than the build server and this created the precompiledapp.config file. I copied all the files across to the server (except web.config which I left intact) and it logs successfully (which suggests the global.ascx events are being fired). What I need to do now is try and get the build server to do the same thing - any ideas?
Make sure your custom config file is set as a content file and Copy To Output is set to Always in the config file properties in Visual Studio.
I seem to have resolved this issue now.
As I mentioned in the Edit of my original message, when I published the website through Visual Studio 2010 to a local folder it created the Precompiledapp.config file, and copying the folder contents to the test version of the application got everything working. As I can't seem to get the TFS Build server to create this file, I decided to try just copying the file from my local publish folder to the test application, along with the rest of the files from the tfs build, and everything seems to be working as it should.
So although I've not managed to figure out how to get the build server to generate this file, my main issue is resolved and I'm able to use the global.asax file again.
I'm late to this question BUT you should probably verify that you have the correct SDK that visual studio would use to build the precompiled app (I think it's Azure SDK even if not doing anything with Azure but not 100% on that).
If you have visual studio installed on the build server you can just install the web workload (opening the solution will prompt it). I did this with Visual Studio 2019 today. MSBuild was ignoring not only my *.pubxml settings but even passed in properties via command line arguments to msbuild.exe (which overwrite the ones in the *.pubxml file).
I opened Visual Studio, it prompted me to install the necessary workload and I did. Everything started working as expected after that.
To precompile, in your pubxml file make sure to have this:
<PrecompileBeforePublish>True</PrecompileBeforePublish>
Also, this post refers to your Edit comment about how to get the build server to do it when it works on your machine.

How can I create a vs.net website project from existing files on a server?

I am taking over a project that has all the files on the server. It seems the project was build using a website project type.
What is the best way for me to re-create a vs.net solution?
Update
So I pulled all the files down, saved the solution.
Trying to Run the application but it says 'getting files from server...", how to I configure it to run locally now?
What I would do is copy all of the files locally first
Then create a new empty solution
Then right click and Open Existing Project (website)
Point to the existing file folder on your local machine
and there you should have all your files in working order.

Categories

Resources