3

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?

7 Answers 7

7

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 BUILD 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.

Sign up to request clarification or add additional context in comments.

Comments

2

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.

2 Comments

Correct, but the policies have changed with Fx3.5SP1, a share is now considered (mostly) equal to a local folder.
@HenkHolterman: except when your internal IP addresses are actually routable :(
1

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"

4 Comments

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 - True, you could also run "programName inputParameter1 inputParameter2" from the command line.
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.
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.
1

You can use Publish feature of VS. Note that you can change settings in the Publish section of the console application project to remove some features that you don't need. For instance the renaming of .dll and .exe files by appending the '.deploy' extension to the name of the files or publishing in a new 'version' folder each time. Go to "Project Properties"->"Publish" and remove "Automatically increment revision" checkbox at "Publish Version", click "Options..." button and clear all checkboxes there too.

Comments

0

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.

Comments

0

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.