[英]Deploy C# multi layer project to a test system (UI/BLL/DAL/WebService)
I have a multi-layered C# project (.Net 4.5 framework): UI, BLL, DAL and Webservice. 我有一个多层C#项目(.Net 4.5框架):UI,BLL,DAL和Webservice。 I need to deploy this project on a test PC but not able to know how.
我需要在测试PC上部署该项目,但不知道如何操作。 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.
测试PC已安装了SQL Server和IIS,但我不知道如何设置要在测试PC上使用的连接字符串,以及如何部署exe并使Webservice在PC上本地运行。 I tried to publish the application using visual studio (2013) and then install it on the PC but that method failed.
我尝试使用Visual Studio(2013)发布应用程序,然后将其安装在PC上,但该方法失败了。 What should I do?
我该怎么办? 1- How to change the connection string to match the SQL server's settings installed on the PC?
1-如何更改连接字符串以匹配PC上安装的SQL Server设置? 2- How to deploy Webservice?
2-如何部署Web服务? Note that the other PC is not on the same network of mine.
请注意,另一台PC不在我的同一网络上。
I hope You can help me here or else let me know that this is not the right website to ask such question. 希望您能在这里为我提供帮助,否则请让我知道,这不是询问此类问题的合适网站。
1 - You can create different configurations in visual studio through the configuration manager - the dropdown next to the play icon. 1-您可以通过配置管理器-播放图标旁边的下拉菜单在Visual Studio中创建不同的配置。 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. 然后,您可以为每个配置/环境使用不同的配置文件(web.config或app.config)。 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. 2-您可以使用发布向导通过Visual Studio部署项目-右键单击项目文件->发布。 You can chose the configuration that you want there.
您可以在此处选择所需的配置。 So if you want to deploy to test pick the Test configuration.
因此,如果要部署以进行测试,请选择“测试”配置。
Hope that helps! 希望有帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.