Where is System.ServiceModel.Web.dll?

2019-01-21 18:46发布

I am developing a Windows service that exposes a WCF service intended to be consumed by a Silverlight application, as explained in this blog post: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2008/03/27/10291.aspx

The problem I am facing is that I need to use the WebInvoke attribute, which is defined in the System.ServiceModel.Web.dll assembly, but when I try to add a reference to that assembly in the project (by using Visual Studio's Add Reference dialog - .NET tab), there is no assembly with that name.

So, am I doing something wrong, this assembly is not part of the standard .NET Framework, or it is a bug in Visual Studio? By the way I'm using VS2010 beta 2 and the project targets .NET Framework 4.

7条回答
ら.Afraid
2楼-- · 2019-01-21 19:00

Are you targetting .NET4 Full or Client Profile? The latter does not include the System.ServiceModel.Web assembly.

查看更多
爷的心禁止访问
3楼-- · 2019-01-21 19:00

Please look at the following folder for System.ServiceModel.Web.dll

C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\

查看更多
手持菜刀,她持情操
4楼-- · 2019-01-21 19:02

Check your project properties and on the Application tab make sure you have selected the full ".NET FRAMEWORK" and not ".NET FRAMEWORK CLIENT PROFILE" in the target framework combo.

查看更多
冷血范
5楼-- · 2019-01-21 19:04

Add the following reference to your project

System.ServiceModel.Web.dll

If you are not able to find System.ServiceModel.Web in - 'Add Reference' click on Component Name to sort the list.

查看更多
啃猪蹄的小仙女
6楼-- · 2019-01-21 19:19

I use Visual Web Developer and facing the same issue. My project is already configured targetting .Net 4.0 Framework. The solution for my case is adding reference to my my project by :

right click on References, choose Add Reference and find System.ServiceModel.Web under .Net Tab

查看更多
女痞
7楼-- · 2019-01-21 19:20

Apparently when you select .NET framework 4.0 while creating the project, Visual Studio 2010 Beta 2 actually targets .NET framework 4 client profile. Change the target framework to .NET framework 4 using project properties.

alt text http://i47.tinypic.com/2hgbyb9.png

查看更多
登录 后发表回答