Until now I've been using/practicing the Visual Studio (VS) to create, compile and deploy solutions with a single project. It's pretty straight forward, at least to me. You just go to the ..\bin\release folder and zip all the files in there which also has all the dependencies.
Now I am getting into solutions with multiple projects. I have a windows service project with the following solution arrangement.
Solution-ServiceXYZ
I set the ServiceXYZ as the startup project. It also references projects 1 through 3 each of which also references an external DLL. The build path in each project is the \bin\Release.
What's the best way to build and deploy this windows service? After I build the solution, do I need to manually copy each DLLs from each project and the EXE from the service project to a folder and zip it? I guess I can set the build path in each project to a common folder but that doesn't seem right.
The ServiceXYZ\bin\release folder seems to have all the dependencies, EXE file including the app.config and serviceXYZ.exe.config. Is it because this project is the startup project? Also, I only want the serviceXYZ.exe.config, not the app.config because it may confuse the users. I guess I don't have to copy it for the deployment.
Add log4net to this mix and now I am pulling my hair as to where the logfile is and where is the log4net.config should be.
What's the best way to set an output directory for the entire solution so all the DDLs, EXE and log4net.config and mylog.log will be in one location?
Thanks
When you add .EXE
files to your project, look for their properties. There you will find a property CopyToOutputDirecory
. Set it to TRUE
.
When you add references, .dll
s, look for their properties. There you will find a property CopyLocal
. Set it to TRUE
.
Same for the other files, you should get a property Copy To Output Directory
.
When you add another project to the current project, set its output directory to same as the current. Means the output directory for both the projects must be same.