添加 .svc 文件丢失 [英] Adding .svc file missing

查看:35
本文介绍了添加 .svc 文件丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将 .svc 文件添加到我已添加到解决方案中的 WCF 服务库(这没有 .svc 文件).如果我通过新项目(例如 test.svc)指定此文件,则这是安装程序文件,而不是 WCF 文件.

I need to add a .svc file to WCF Service Library I have added to a solution (This doesn't have the .svc file). If I specify this file through ad new item (eg test.svc), this is an installer file not the WCF file.

如何将此文件添加到我的项目中?

How can I add this file to my project?

谢谢

推荐答案

您不能将 .svc 文件添加到 WCF 服务库 - 您需要将 WCF 服务文件添加到 ASP.NET 网站或 ASP.NET 网站在您的解决方案中应用.

You cannot add a .svc file to a WCF service library - you need to add the WCF service file to a ASP.NET web site or ASP.NET web application in your solution.

在 Web 应用程序或网站中,您可以右键单击项目,选择添加新项目",然后从对话框中选择WCF 服务".这会将必要的 .svc 文件添加到您的网站或网络应用.

In a web application or web site, you can right click on the project, choose "Add New Item", and then pick "WCF Service" from the dialog. This will add the necessary .svc file to your web site or web app.

svc 文件必须作为容器位于 Web 应用程序/网站中 - 它不能驻留在 WCF 服务库中.

The svc file must to be in a web app/web site as a container - it cannot reside in a WCF service library.

马克

这篇关于添加 .svc 文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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