Copy file to debug directory on preview - winforms

When I use the "Start without Debugging" button in Visual Studio, my app is copied to a debug directory and runs from there, which I discovered via Environment.CurrentDirectory.
However, there is a text file in the root of the project that I also need to copy, regardless of the build options. When I press "Start without Debugging", this file is never copied, despite the properties set:
Can anyone please provide instructions on what options to include this file when starting without debugging?

Oddly enough, I don't have the "AdditionalFiles" listed in my WinForms app Build Action, also tried with VS2015. Though setting the Build Action to "Content" works for me, when doing the CTRL-F5.

Related

How do I make my Setup project produce an executable?

I've built a small desktop application with which I am trying to use a Setup project to allow other users to install it. But whenever I run this installer, it does not produce an executable file. This is my first time making a setup project.
My solution contains two projects. One is the setup project which installs the primary output from the other project. The other project is a WPF App that consists of two xaml files, a xaml.cs file for each, an App.config file, and an icon. It also has a few dependencies including one Assembly, two Frameworks, and a handful of Packages. The app works exactly as intended whenever I start a Visual Studio debugging instance on either Debug or Release configurations.
I followed these instructions to build my Setup and deploy my app.
Whenever I ran the resulting Setup, it installed an XML configuration file, a JSON file, a main application dll file, and a bunch of dll files for my assemblies. I looked into some resources on how to run the main dll file properly, only (A) I'm completely stumped by everything I find on that topic, and (B) I would rather just produce an executable file anyway, since I intend for this Setup project to be used by other people and it would be inconvenient to ask said others to jump through the same hoops just to run it.
Why does my Setup project not produce a .exe file? I see that a .exe file is produced in my bin folder whenever I build my project (and this .exe works), so I would think the setup project should also produce one of those, but it doesn't. What am I doing wrong with my Setup project or anything else?
The setup.exe is a bootstrapper over the setup.msi. We can install the content using .msi or by running .exe which inturn runs /gets the data from the msi. To enable setup.exe building, go to solution explorer -> project -> properties -> prerequisites. check the check box on the top "Create setup program to install prerequisite components". apply and rebuld the project. A setup.exe bootstrapper will be created allong with msi.
Switch to Release mode, then rebuild your setup project. If everything went well (check the output console), you'll find an MSI file inside {setup project folder}/bin/Release
In "system file" from your proyect installer, you shoud to add in "Application Folder" the next source = PublishItemsOutpuGroup. In my case functions well.

Build project to run it in eclipse

My code runs a previous version of itself, so even though i completely remove all the code, it still runs the old one. I've read a few other posts regarding this problem, and tried it out. My temporary solution is to build the project before running it, but that is kinda stupid. the .exe file is in the Release folder, and my Debug folder dissapeared after the Clean.
How do I stop needing to build the project before everytime I need to run it?
I found out there's a button called auto build in the Launch Configuration properties window. So it build everytime I run it.

error=13, Permission denied when adding event in CodenameOne

Suddenly, and for no apparent reason, whenever I try to add an event to a form element, like a button, in codenameone I get an error:
Cannot run program /path/to/project/src/theme.res: error=13,
Permission denied
This worked fine for several days before now. But now I get the error every time. I tried to create a brand new project from scratch and still get the error. What is really weird is that the /path/to/project/ is for the original project, not the new one! And when it appears for this case, it is file not found instead of permission denied. (Both files ARE there.)
I have searched all over the net and stack exchange and can't find any other reference to this problem.
I had this same issue. It happened after I deleted a project's files without removing the project from NetBeans first. Not sure why that caused it but that is the only thing I can think of because the theme.res file that "could not be found" was for the project that I had deleted.
For some reason the CN1 designer thinks that your theme.res file is the NetBeans executable.
To fix this, open the designer and click on File -> Setup Netbeans, then find your netbeans executable and select it. For me (on linux) it was
home/user/netbeans-8.1/bin/netbeans

Eclipse Project Settings Not Transferring to New Project

I have the source from an Eclipse project, and I need to import all of the build settings as well as the source into a new project so I can make some changes. The trouble is, when I go to build the project, Eclipse is calling the internal builder and NOT calling the Makefile from the previous project (which I have imported). The makefile contains some values in #define statements that need to be passed in on the command line.
When I go to change these options in Eclipse (by right clicking on the project and going down to "Properties" and then examining the "C/C++ Build" tab) they are grayed out!
If someone could help me out I'd greatly appreciate it.
Thanks all!
There is a folder called ".settings" under your project, copy this (and everything under it) to your new project, this is where all of the settings are stored. To see the folder, you may need to use the view menu (upside down triangle) in the Package or Project Explorer and remove the filter on the ".resources". For Package Explorer select the "Filters", in Project Explorer use "Customize View"

WPF app crashing after ClickOnce update. Does not crash on clean install

My WPF application is crashing after we publish an update via ClickOnce with:
'The invocation of the constructor on type 'MainWindow' that matches the specified binding constraints threw an exception.' Line number '12' and line position '9'.
from Void RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
This only happens on machines after they apply the update. A machine that gets a clean install runs fine. If you uninstall the app and reinstall it, it runs fine.
I found this question, which seems to be the same thing
In my case, if you double-click the app in the deployment folder (C:\Users\username\AppData\Local\Apps\2.0 etc.) it runs with no issues. It only crashes if you run it by clicking the icon that is installed on the user desktop. And again, only when it has done an update.
Any advice for troubleshooting/remediating this is appreciated.
This makes me wonder if there's a path somewhere that's getting set when you first install, and the path no longer works when updating. You're not storing a path anywhere are you? In a settings file or config file?
Have you tried to create a shortcut from the deployment folder, and copy it on the desktop ?

Resources