tags:

views:

210

answers:

7

I have a simple C# console application developed on my local machine using VS2008 Pro. I want to know how to deploy this solution onto a network share folder?

A similar Java console program is already placed (as a JAR file) in the same network share folder. Users simply open command prompt, navigate to shared folder and type "java -jar programName.jar inputParameter1 inputParameter2"

How can I achieve the same with .NET?

A: 

Right click your project, select publish which will make an executable, you can put that in your shared drive, similarly users can go into the command prompt and run it and give some args.

Daniel
+1  A: 

It would be mostly the same process as the Java program. To deploy, compile the program and copy the exe from the bin folder (along with any dependencies) to the network share.

To run the program users would open the command prompt, navigate to shared folder, and type "programName.exe inputParameter1 inputParameter2"

Greg
You don't even need the .exe! ;) But yeah, it's an almost identical process to the Java version described by the OP, w/ the exception that you don't need to invoke the JVM and just run the executable directly.
bakasan
@bakasan - True, you could also run "programName inputParameter1 inputParameter2" from the command line.
Greg
Thanks for the response. However I am still unable to deploy this app successfully. I did publish it to the network share folder using ClickOnce. On the share drive I get the following structure 1. Application Files (folder) -> ABC_1_0_0_1 -> ABC (application manifest) ABC.exe.deploy ABC.exe.manifest Interop.DSOFile.dll.deploy 2. ABC (application manifest) 3. setup (application)I then RDP to the target machine and navigate to shared folder above. I double click Setup.exe Command propmt screen flahes indicating the program ran, but would have exited on account of no input parameters.
DRags
If you are simply placing the program on a network share, I wouldn't mess with publishing or ClickOnce. Just compile the program and copy the contents of the bin folder to the share.
Greg
+1  A: 

If your application is really "simple", you should be able to just copy the files to a shared folder and run it from there. However, if your "simple" application tries to do things that are restricted by the permissions you might have to configure them with caspol. Assemblies loaded from a shared drive have much fewer permissions than the ones loaded from a local drive.

Otávio Décio
Correct, but the policies have changed with Fx3.5SP1, a share is now considered (mostly) equal to a local folder.
Henk Holterman
@Henk - that is correct, thank you.
Otávio Décio
+1  A: 

You can copy the exe over yourself, go to the bin folder in the directory your source code is in and copy it there.

or you can click the debug menu and use the publish menu item. This will allow you to enter the path to your network share and visual studio will copy the built app to the folder for you.

Glenn Condron
A: 

In the exact same way assuming they have the proper dependencies installed (.net, 3rd party assemblies, etc). copy the bin folder then have them execute the exe file.

Fred
A: 

Take a look at ClickOnce deployment:

ClickOnce is a Microsoft technology for deploying Windows Forms or Windows Presentation Foundation-based software, also called Smart clients. It is similar to Java Web Start for the Java Platform.

MSDN

Wikipedia

Philip Wallace
A: 

Thank you for your response. However I am still unable to deploy this app successfully. I did publish it to the network share folder using ClickOnce. On the share drive I get the following structure 1. Application Files (folder) -> ProgramName_1_0_0_1 -> ProgramName (application manifest) ProgramName.exe.deploy ProgramName.exe.manifest Interop.DSOFile.dll.deploy 2. ProgramName (application manifest) 3. setup (application)

I then Remote Desktop to the target machine and navigate to shared folder above. I double click Setup.exe Command propmt screen flahes indicating the program ran, but would have exited on account of no input parameters.

DRags