WCF 服务库模板在 Visual Studio 2013 express 上不可用? [英] WCF Service Library template not available on Visual Studio 2013 express?

查看:23
本文介绍了WCF 服务库模板在 Visual Studio 2013 express 上不可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很想使用 WCF 服务库模板进行开发,但我的结论是它在 express 版本上不可用.有人可以确认吗?我已经尝试了 installVStemplates,并重新安装了该软件.似乎没有运气.我希望我可能以某种方式错了.

I really want to develop using the WCF Service Library template, but I am concluding that it is not available on the express version. Can anyone confirm? I've tried the installVStemplates, and re- installing the software. No luck it seems. Am hoping I might be wrong somehow.

推荐答案

本质上,WCF 服务库是一个类库 (DLL),其中包含服务契约及其实现(如果契约在一个单独的项目).

A WCF Service Library is, in essence, a class library (DLL) that contains the service contract and its implementation (or just the implementation if the contract is in a separate project).

虽然 WCF 服务库模板是创建 WCF 服务库的便捷方式,但它添加的唯一内容是 IService1.cs/vb 接口,Service1.cs/vb 实现、一些样板代码以及对 System.Runtime.SerializationSystem.ServiceModel 的引用.

While the WCF Service Library template is a convenient way to create a WCF Service library, the only things it adds are the IService1.cs/vb interface, Service1.cs/vb implementation, some boiler plate code, and references to System.Runtime.Serialization and System.ServiceModel.

如果您没有模板,您可以执行以下操作:

If you don't have the template, you can do the following:

  1. 用您选择的语言创建一个新的类库.
  2. Class1.cs 重命名为您的服务名称.
  3. 为服务合同添加一个接口.
  4. 添加对 System.ServiceModelSystem.Runtime.Serialization 的引用(如果您将使用 DataContracts,则为后者).
  1. Create a new Class Library in the language of your choice.
  2. Rename Class1.cs to your service name.
  3. Add an interface for the service contract.
  4. Add a reference to System.ServiceModel and System.Runtime.Serialization (the latter if you'll be using DataContracts).

自 2010 年以来我就没有使用过 Express 版本,我不记得您是否可以使用 Visual Web Developer Express 创建类库,因此您可能需要使用 Express 2013 for Windows Desktop.

I haven't used the express editions since 2010, and I don't remember if you can create class libraries with Visual Web Developer Express, so you might need to use Express 2013 for Windows Desktop.

如果没有模板(大约 5 分钟或更短),这会增加一些额外的工作,但您仍然可以做到.

It's a little extra work without the template (about 5 minutes or less), but you can still do it.

这篇关于WCF 服务库模板在 Visual Studio 2013 express 上不可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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