从类库转换为 WCF 需要采取哪些步骤? [英] What steps do I need to take to convert from a class library to a WCF?

查看:27
本文介绍了从类库转换为 WCF 需要采取哪些步骤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个项目作为类库.现在我需要把它变成一个 WCF.我可以创建一个 WCF 项目,但我想避免对 TFS 的所有大惊小怪.我已经完成了 App.config 并将/client:"wcfTestClient.exe" 行添加到命令行参数中.但它启动托管似乎还缺少其他东西.

I created a project as a Class Library. Now I need to make it into a WCF. I can create a WCF project, but I would like to avoid all that fuss with TFS. I've done the App.config and added the /client:"wcfTestClient.exe" line to the Command line arguments. But there seems to be something else missing from it launching the Hosting.

推荐答案

我发现以下内容与您要实现的目标相反,即将服务库更改为控制台应用程序..

I discovered the following doing the opposite to what you are trying to achieve, i.e. changing a service library to a console application..

csproj 文件中的某些设置无法从 VS 中的设置屏幕进行编辑,以将类库转换为 WCF 服务库,您需要将以下内容添加到项目文件中

some of the settings in the csproj files cannot be edited from the settings screen from within VS to convert an class library to a WCF Service Library you need to add the following to your project file

将以下内容添加到第一个 PropertyGroup [这些是 C# WCF 项目的 guid]

Add the following to the first PropertyGroup [these are the guids for a C# WCF Project]

<ProjectTypeGuids>{3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

有关ProjectTypeGuids

您可能还需要在紧接下面添加以下行:

You may also need to add the following line immediately below:

<StartArguments>/client:"WcfTestClient.exe"</StartArguments>

但最终,您需要手动插入 PropertyTypeGuids 才能让 VS 将项目识别为 WCF 服务库项目.

But ultimately it's the PropertyTypeGuids that you need to manually insert to get VS to recognise the project as a WCF Service Library Project.

这篇关于从类库转换为 WCF 需要采取哪些步骤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆