I have built a Windows Service app in .NET (C#C) that is currently running on my local PC (Win& 64 bit) and it has it's own Event Log File as well as a custom log file for post debugging which logs out to c:\ProgramData\MyAppName\
.
I have the main 2 DLLs in one project which has all the main functional code.
These are hooked into by the Service VS Project which also contains a Windows Form Project which sits in desk tray and gives me a status on the service, as it uses a 3rd party API, whether the API is up and running, any current error, plus it has buttons enabling me to stop/start the service if I need to.
However I am having to move this all to a Windows 2012 Server and there are a few issues I need to resolve.
- There is no Visual Studio on the server so no directories for me to place my projects, rebuild them and run them and let the other apps hook into the DLLs which I have to do with "Add reference" etc.
Should I download VS Web Edition or something to the server to make this easier to manage / debug / code if I need to?
Or is there another way e.g just copy the DLL's and regsrvr them to install then copy the service/app to the server and it would automatically have references to it working and if not what is the procedure.
The main code is in the DLL which I built which also comes with a JSON 3rd party API built DLL.
These both get re-created when I rebuild the main project, then I have to remove and re-add them both to the service and the win forms projects before rebuilding them for them to run correctly.
How do I go about this without VS on the server
- can I keep the debugging/making of the code to my PC and just copy the files over? -will the links to the DLLS from the Service/App still work despite the paths being different? -If not what should I do? -Also where is the best folder to store them?
Also I notice despite me having admin/root access to the server (RD/SFTP/Win Share), I cannot see a c:\ProgramData folder on the C:\ drive. This is where all the logging from my app when it's running 24/7 goes when running on my PC. It creates one log file per day, 2 historical - all for post process debugging etc.
Is this because it's a Win 2012 Server and the code I use to get the path in my project which is
this.Logpath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\" + NameOfMyApp;
works differently e.g Environment.SpecialFolder.CommonApplicationData is a different folder on Win 2012, or do I need to do something to show the ProgramData folder up so I can browse it normally?
I remember recently when I did a Windows Update on my Win7 machine something mucked up (apparently common with Win7) and I couldn't see the ProgramData folder then (service was still running) - until my profiles were swapped over (it was using a default temp profile which is why all my desktop icons went along with bookmarks and folders).
So I am trying to move these 2 VS projects (or the working code they create) from my Win7 64 bit machine to a Win 2012 64 bit server.
What are the best steps to take to get everything working and the folders all showing (programdata), plus the service up and running without having Visual Studio on the server?