How to run a command line console application?

Hello all.  I need to run this command line console application on a machine where SSIS business intelligence studio exists but I dont have the C# environment etc.  How do I create this and run it on my server?  I do have the .Net studio on another machine
using System;
 
using Microsoft.Win32;
 
 
 
namespace CheckClsidPerm
 
{
 
    class Program
 
    {
 
        static void Main(string[] args)
 
        {
 
            RegistryKey clsid = Registry.LocalMachine.OpenSubKey(@"Software\Classes\CLSID");
 
            string[] clsids = clsid.GetSubKeyNames();
 
            Console.WriteLine("found {0} keys", clsids.Length);
 
 
 
            foreach (string s in clsids)
 
            {
 
                try
 
                {
 
                    using(RegistryKey clsidKey = clsid.OpenSubKey(s))
 
                    {
 
                        using(RegistryKey ic = clsidKey.OpenSubKey("Implemented Categories"))
 
                        {
 
                        }
 
                    }
 
                }
 
                catch( Exception e )
 
                {
 
                    Console.WriteLine("error while reading key {0}: {1}", s, e.Message);
 
                }
 
            }            
 
        }
 
    }
 
}

Open in new window

sbornstein2Asked:
Who is Participating?
 
SwissKnifeConnect With a Mentor Commented:
Hello sbornstein2

After compiling your application in the Visual Studio, you have the sub folders <ProjectFolder>\Bin\Release or <ProjectFolder>\Bin\Debug with an the compiled .exe in it.

You can copy this file to the Server.

On the server, the .Net Fraemwork must be installed.

If you have not only the the Express edition of the Visual Studio, you can add a deployment project to your solution. Use the context menu on the solution node and a new setup and deployment project with the wizard. A screen shot is attached

Teh result is a installable .msi file

Setup.PNG
0
 
PockyMasterCommented:
if you have the c# environment on your other machine, you can walk over there.. and create a new console application and copy past the code build it, and copy the project output to your other machine.
0
 
JimBrandleyCommented:
You will have to have the .Net framework installed on the server.

Jim
0
All Courses

From novice to tech pro — start learning today.