什么步骤我需要从一个类库转换为WCF? [英] What steps do I need to take to convert from a class library to a 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>
但最终它是你需要手动插入得到VS认识到该项目作为一个WCF的PropertyTypeGuids服务库项目。
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屋!