Reputation: 730
I have a multi-layered C# project (.Net 4.5 framework): UI, BLL, DAL and Webservice. I need to deploy this project on a test PC but not able to know how. Test PC has SQL server and IIS installed, but I couldn't know how to set to connection string to be used on the test PC, and how to deploy the exe and make the Webservice work on the PC locally. I tried to publish the application using visual studio (2013) and then install it on the PC but that method failed. What should I do? 1- How to change the connection string to match the SQL server's settings installed on the PC? 2- How to deploy Webservice? Note that the other PC is not on the same network of mine.
I hope You can help me here or else let me know that this is not the right website to ask such question.
Upvotes: 0
Views: 382
Reputation: 621
1 - You can create different configurations in visual studio through the configuration manager - the dropdown next to the play icon. By default you get Debug and Relase. It's a good idea to have one per environment. So like in your case you can create one called "Test".
Then you can have different config files (web.config or app.config) for each configuration/environment. For each config you can have different connection strings. This way you can manage having connection string for your local machine and another one for your test machine.
2- You can deploy your project through visual studio with the publish wizard - Right click in the project file -> Publish. You can chose the configuration that you want there. So if you want to deploy to test pick the Test configuration.
Upvotes: 1