Build for standalone release with VS Express?

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I have VS Express C# and I am trying to build for release, simply meaning so it can run on a PC without VS installed and just the target .NET platform.

I have the project properties tab which I can use to configure build settings. I can set configuration and versions, but it seems I cannot build directly to a specific folder and vile version.
There is the publish function, which seems to be what I want, if auto increments versions and I give it a destination to publish, but it only seems to like URLs.

In my project folder, I have Debug and Release folders in the obj and bin folders. Is one of these the Release version of the program I can use?

In both folders, I have the executable, a pdb file and a DLL file. Is it possible to build these files into one. I would much rather not have to deal with 3 files, just one consistent fully contained executable package.

I searched online and cannot believe I could not find any related topics for this.

Thanks,
elkinm
 

brandonb

Diamond Member
Oct 17, 2006
3,731
2
0
I'm not sure if Express has it, but can you add a new project of type "Setup and Deployment Wizard"?

image002.jpg
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I did get the application to publish to a folder, however it created an installer executable which I guess will just copy the needed files to a specific folder on install.

I will try using it, however the best option would be a singe standalone exe file without a need to install.

Thanks again.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
My new project window looks entirely different. Do you have 2008 or an older version I also only have a project name, not a location.
It may only be 2008 express, as I have many more options than with a 2010 express install?

Thanks
 
Last edited:

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I tried installing the application from the published location and discovered that it is also not a standalone install, it requires the files in the Application Files folder created during publishing.
 
Last edited:

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I did some more research about setup and deploy and it creates a singe msi file that can be installed on a different PC. I also have not found a way to do this in express.

The application is intended for non-it savvy users with limited user privileges so they cannot even install from a basic MSI package. They can run basic executable though.
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
if there is a dll in the debug/release folder it is most likely some external library that you are using in your project and you cannot include it into the exe unless you wrote it.

The pdb file is not needed for deployment.

So, depending on what the dll file is- you should just be able to distribute the exe and as long as the framework is installed, it will work. (assuming no external libraries were used)
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
Found one online post which said that VS, at least 2005 cannot compile to a single executable.

If that truly is the case, is it possible to use some virus techniques and bind the files together after they were released so they still show up as one file to the user?
 

Apathetic

Platinum Member
Dec 23, 2002
2,587
6
81
How many project folders does your solution file contain? If it's two that's why your getting a seperate DLL when you build.

Dave
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
How many project folders does your solution file contain? If it's two that's why your getting a seperate DLL when you build.

Dave

I am not sure what you mean, I have the folder with the solution file with 1 subfolder with all the individual project files as well as a bin, obj, and properties folders.

I am sure that WannaFly is right and the dll is because I am using an external library installed on the machine. The interesting part is that the PCs have the libraries installed and registered and should not require an additional DLL as there may be a version mismatch between the DLL on the dev machine and the user machine.
The two should be compatible, but the application should be using the DLL installed on the user's machine, not the one provided by the application.

The library is provided to me and is not under my control. I will try contacting their support and ask what I need to do and how it should work.

Thanks again.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
A slightly different annoyance. I ran the application and noticed that the startup form displayed form1 in the title. I did not like it so I went back to VS and renamed the form to Application. (maybe a little stupid) anyway, I realized that I should not have changed the form name, just the title.

To ensure the best chance of not making any actual changes, I hit the undo button to undo me changing the form object name thinking that my project will remain intact.

Unfortunately I discovered that any use of the word application was then changed to Form1 so any time I had an Application.Run() or Applicatin.DoEvents() it bcame form1.Run() and Form1.DoEvents().

I thought this was incredibly stupid for VS especially since I used Undo to try to prevent such an occurrence.
Have you guys ever encounter this problem?
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
If the dll is registered on the client computers you still should be able to redistribute just the exe. BUT, as you mentioned, the version mismatch will cause a problem even though the interfaces are the same. Develop with the same version that is on the clients. You can use assembly/redirect/binding in the app.config to fix the problem, but that would require also using a 2nd file. I'm not sure you can redirect problematically.

As far as your application rename, it sounds like a minor bug, but it almost makes sense - since your form overrode the application name, it would replace all instances of it with form1 when you renamed it. Now, since form1 did not have a .run or .doevents method, maybe it shouldn't have.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I got a reply from the API developer and they said that since the API is C++ and I am coding in C#, it need an Interop DLL to do the translation and that is why it is there.
I am hoping they have a better way to deal with this. C# is their recommended build language.

What bothers me with the rename is that I did Undo and it did not work. I expect that undo will restore something to exactly the way it was before the change. It seems that is not the case, which to me means I have to very careful using Undo if I can use it at all.

The VS rename function smart rename function is even worse. If I rename a variable it offers to rename all instances of that variable, and Rename with preview which I would think lets me se what it renames before it does it, but it does nothing for me. I find myself using the find/replace which is much more reliable.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
Just as an experiment, I tried installing the program from release folder I created earlier. After a windows prompt, it installed the program somewhere and even created a program entry in add-remove programs. I don't know where and how it installed it, but if I copied the program elsewhere it said the program is installed in another location.

Then I tried creating a new release build. It created a new release folder, but nothing else changed and I don't even know which version is installed when I run setup.

Is there something special that needs to be done to control it, like where it is installed, how, shortcuts, files, ect.

To simplify things, does anybody know of a good site or tutorial focusing on nothing but how to build a basic application or installer and be able control everything that happens or at least get a detailed log of the install so I can track it manually.

Thanks again.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
The API developers pointed me to this link: http://msdn.microsoft.com/en-us/library/tc0204w0.aspx

So I guess .NET 4.0 is capable of imbedding interop DLLs.

Another thing I noticed, the API application always has the Interop DLL in it's own folder. That is where the compiler gets the DLL to put it with my program. The question is, how can I have my program and/or windows to use the already available Interop dll in the API folder instead of adding each one with the application.
If the external API is not installed the program would not work so there is no need to worry about it running on a machine without a pre-installed interop dll.
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
Going through the link above, it seems that I have a private assembly as I don't have a publisher key, which means it must be in the same folder as the application.

Can I apply some publisher key or do something to get around this limitation and have the system use the default DLL installed with the external API?
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I moved the standalone files to a separate PC and had no problems starting the application.

Something interesting I noticed. The entire screen draw rate has decreased or at least is messed up.

Every one in a while, my entire screen flashes and windows refresh themselves.

I noticed that if I launch task manager it is like strobe lights. Every window on the screen flashes like crazy and the Explorer window and the desktop Icons all redraw (disappear for a fraction of a second and re-show up)

I also noticed it all depends of which program has focus prior to the event. If my application has focus, this happens, otherwise everything is normal.

Any idea how my app can be affecting the how machine this way and how to stop it. I am using Graphics optimizations for C# I found such as AllPaintingInWmPaint, UserPaint and OptimizedDoubleBuffer. Can any of these the system drawing?

Thanks
 

elkinm

Platinum Member
Jun 9, 2001
2,146
0
71
I tried it without the setstyles optimizations. The problem still occurs, but this time it is not as distinct to which program has focus.

Anybody know what in VS apps can cause full-screen flicker?