简体   繁体   English

将C#多层项目部署到测试系统(UI / BLL / DAL / WebService)

[英]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.

相关问题 BLL,DAL,OBJ和3层架构 - BLL, DAL, OBJ and 3 layer architecture C#Winform-DAL和BLL-使用静态方法好吗? - C# Winform - DAL and BLL - usage of static methods is good? 如何在C#中将Linq查询结果从BLL层返回到UI层 - How to return Linq query result from BLL layer to UI layer in C# 业务层(BLL)数据访问层(DAL)和UI之间的通用结构? - Common structures between business layer (BLL) data access layer (DAL) and UI? SettingsProvider类-应该在DAL还是BLL项目中? - SettingsProvider class - should it be in DAL or BLL project? c#DAL类和业务层类 - c# DAL class and business layer class 如何为用VB编写的旧ASP站点在C#中编写DAL和BLL - how to write a DAL and BLL in c# for an old asp site written in VB C# | 如何制作 class 实例(对象)以将数据从 DAL 传递到 BLL - C# | How to make class instances (objects) for passing data from DAL to BLL 从 C# 层 (BLL) 连接到 socket.io - Connect to socket.io from C# layer (BLL) 除了实例化DAL的BLL之外,什么选项允许在n层解决方案中进行单元测试,而不会将DAL暴露给UI或BLL到DAL? - What option other than a BLL instantiating a DAL allows for unit testing in an n-tier solution without exposing DAL to the UI or BLL to DAL?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM