无法获取的Web API在VS 2010或2012年工作 [英] Cannot get Web API to work in VS 2010 or 2012

查看:189
本文介绍了无法获取的Web API在VS 2010或2012年工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台机器用VS 2012 VS2010的RC在其上运行。我想请遵循code <一个href=\"http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api\">http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api尝试的Web API。我试图根据网站上关于如何解决问题的一些不同的链接,但还是不能让网页API使用IIS防爆preSS /卡西尼对我的Windows 7 x64系统中,主机工作。目前,我得到未找到方法:'太虚Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(布尔)'。想看看什么应该是产品列表时出错。

我跟着网页正是因为它是写,并没有手动添加任何东西。我也成立了网络堆栈<一夜间库href=\"http://www.myget.org/F/aspnetwebstacknightly/\">http://www.myget.org/F/aspnetwebstacknightly/,但不知道这是否导致了问题。这里的的NuGet的获取,封装上的程序转储如果有帮助。

  PM&GT;获取封装ID版本说明/发行说明
- ------- -------------------------
5.0.0的EntityFramework-RC实体框架是微软推荐的数据访问技术的新应用。
jQuery的jQuery的1.6.2是一种新的JavaScript库....
jQuery.UI.Combined 1.8.11 jQuery UI的是接口组件的开源库 - 互动,全功能小部件,和动画效果 - 基于恒星jQuery JavaScript库。每个组件是建accordin ...
jQuery.Validation 1.8.1这个jQuery插件使简单的客户方表单验证琐碎,同时提供大量的选项定制。这使得一个不错的选择,如果你从头开始构建新的东西,也ÿ时...
knockoutjs 2.0.0一个JavaScript库MVVM帮助您创建清洁维护code丰富的,动态用户界面
Microsoft.AspNet.Mvc 4.0.20505.0这个软件包包含了ASP.NET MVC运行时组件。 ASP.NET MVC为您提供了一个强大的,基于模式的方式来构建动态网站,能够清楚的关注点分离,让你...
Microsoft.AspNet.Providers .... ASP.NET 1.0提供通用的添加SQL Server 2005的所有版本及更高版本和到SQL Azure在ASP.NET 4提供支持。如果使用这些供应商来开发应用程序,该应用程序将b ...
Microsoft.AspNet.Providers .... ASP.NET 1.0提供通用的添加SQL Server 2005的所有版本及更高版本和到SQL Azure在ASP.NET 4提供支持。如果使用这些供应商来开发应用程序,该应用程序将b ...
Microsoft.AspNet.Razor 2.0.20505.0此包包含ASP.NET网页运行时组件。 ASP.NET网页和新的Razor语法提供了一个快速,简洁,干净,轻量级的方式服务器code。与HTML相结合,创建的D ...
Microsoft.AspNet.Web.Optimi ... 1.0.0-β2ASP.NET优化引入了一种方式来捆绑和优化CSS / JS文件。
Microsoft.AspNet.WebApi 4.0.20505.0此包包含您需要托管在IIS上的ASP.NET Web API的一切。的ASP.NET Web API是一个框架,可以很容易地构建达成广泛的客户群,其中包括浏览器中的HTTP服务...
Microsoft.AspNet.WebApi.Client 4.0.20505.0这个包增加了对格式和内容协商System.Net.Http支持。它包括JSON,XML和形式URL连接codeD数据支持。
Microsoft.AspNet.WebApi.Core 4.0.20505.0此包包含的ASP.NET Web API的核心运行时组件。这个包被的ASP.NET Web API运行时主机上使用。若要在IIS托管的Web API使用Microsoft.AspNet.WebApi.WebHost packag ...
Microsoft.AspNet.WebApi.Web ... 4.0.20505.0此包包含您需要托管在IIS上的ASP.NET Web API的一切。的ASP.NET Web API是一个框架,可以很容易地构建达成广泛的客户群,其中包括浏览器中的HTTP服务...
Microsoft.AspNet.WebPages 2.0.20505.0此包包含ASP.NET MVC和ASP.NET网页之间共享的核心运行时组件。
Microsoft.jQuery.Unobtrusiv ... 2.0.20505.0 jQuery插件,可以让你悄悄地成立了jQuery的阿贾克斯。
Microsoft.jQuery.Unobtrusiv ... 2.0.20505.0 jQuery插件,悄悄地建立jQuery.Validation。
Microsoft.Net.Http 2.0.20505.0这个包提供了一个编程接口为现代HTTP应用程序。该软件包包括HttpClient的发送请求通过HTTP,以及Htt的prequestMessage和Htt的presponseMessage为PROCE ...
Microsoft.Web.Infrastructure 1.0.0.0这个软件包包含了Microsoft.Web.Infrastructure组件,可以让你在运行时动态注册HTTP模块。
Modernizr的2.0.6 Modernizr的添加类的&lt; HTML和GT;元素,让你可以在你的样式表针对特定的浏览器功能。你实际上并不需要编写任何JavaScript使用它....
Newtonsoft.Json 4.5.1 Json.NET是.NET流行的高性能JSON框架
WebGrease 1.0.0网络润滑脂是优化的JavaScript,CSS文件和图像的工具套件。


解决方案

我打开包含$ P $租赁前的为的NuGet和更新所有的包到最新版本每晚。它定格在2012年VS问题不知道VS2010虽然。

I have a machine with the RC of VS 2012 and VS2010 running on it. I am trying to follow the code on http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api to try out Web API. I tried following on the web some different links on how to fix problems, but still cannot get Web API to work using IIS Express/Cassini for the host on my Windows 7 x64 box. Currently I am getting "Method not found: 'Void Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)'." error when trying to look at what should be the list of products.

I followed the web page exactly as it is written and didn't add anything manually. I did set up the nightly repository for the web stack http://www.myget.org/F/aspnetwebstacknightly/, but don't know if that is causing the problem. Here's a dump of the NuGet's Get-Package on the program if it helps.

PM> Get-Package

Id                             Version              Description/Release Notes                                                                                                                                                                                      
--                             -------              -------------------------                                                                                                                                                                                      
EntityFramework                5.0.0-rc             Entity Framework is Microsoft's recommended data access technology for new applications.                                                                                                                       
jQuery                         1.6.2                jQuery is a new kind of JavaScript Library....                                                                                                                                                                 
jQuery.UI.Combined             1.8.11               jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built accordin...
jQuery.Validation              1.8.1                This jQuery plugin makes simple clientside form validation trivial, while offering lots of option for customization. That makes a good choice if you’re building something new from scratch, but also when y...
knockoutjs                     2.0.0                A JavaScript MVVM library to help you create rich, dynamic user interfaces with clean maintainable code                                                                                                        
Microsoft.AspNet.Mvc           4.0.20505.0          This package contains the runtime assemblies for ASP.NET MVC. ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you ...
Microsoft.AspNet.Providers.... 1.0                  ASP.NET Universal Providers add provider support in ASP.NET 4 for all editions of SQL Server 2005 and later and to SQL Azure. If you use these providers to develop your application, the application will b...
Microsoft.AspNet.Providers.... 1.0                  ASP.NET Universal Providers add provider support in ASP.NET 4 for all editions of SQL Server 2005 and later and to SQL Azure. If you use these providers to develop your application, the application will b...
Microsoft.AspNet.Razor         2.0.20505.0          This package contains the runtime assemblies for ASP.NET Web Pages. ASP.NET Web Pages and the new Razor syntax provide a fast, terse, clean and lightweight way to combine server code with HTML to create d...
Microsoft.AspNet.Web.Optimi... 1.0.0-beta2          ASP.NET Optimization introduces a way to bundle and optimize css/js files.                                                                                                                                     
Microsoft.AspNet.WebApi        4.0.20505.0          This package contains everything you need to host ASP.NET Web API on IIS. ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers a...
Microsoft.AspNet.WebApi.Client 4.0.20505.0          This package adds support for formatting and content negotiation to System.Net.Http. It includes support for JSON, XML, and form URL encoded data.                                                             
Microsoft.AspNet.WebApi.Core   4.0.20505.0          This package contains the core runtime assemblies for ASP.NET Web API. This package is used by hosts of the ASP.NET Web API runtime. To host a Web API in IIS use the Microsoft.AspNet.WebApi.WebHost packag...
Microsoft.AspNet.WebApi.Web... 4.0.20505.0          This package contains everything you need to host ASP.NET Web API on IIS. ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers a...
Microsoft.AspNet.WebPages      2.0.20505.0          This package contains core runtime assemblies shared between ASP.NET MVC and ASP.NET Web Pages.                                                                                                                
Microsoft.jQuery.Unobtrusiv... 2.0.20505.0          jQuery plugin that lets you unobtrusively set up jQuery Ajax.                                                                                                                                                  
Microsoft.jQuery.Unobtrusiv... 2.0.20505.0          jQuery plugin that unobtrusively sets up jQuery.Validation.                                                                                                                                                    
Microsoft.Net.Http             2.0.20505.0          This package provides a programming interface for modern HTTP applications. This package includes HttpClient for sending requests over HTTP, as well as HttpRequestMessage and HttpResponseMessage for proce...
Microsoft.Web.Infrastructure   1.0.0.0              This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically register HTTP modules at run time.                                                                                   
Modernizr                      2.0.6                Modernizr adds classes to the <html> element which allow you to target specific browser functionality in your stylesheet. You don't actually need to write any Javascript to use it....                        
Newtonsoft.Json                4.5.1                Json.NET is a popular high-performance JSON framework for .NET                                                                                                                                                 
WebGrease                      1.0.0                Web Grease is a suite of tools for optimizing javascript, css files and images.                                                                                                                                

解决方案

I turned on the "Include Prerelease" for NuGet and updated all the packages to the latest nightly release. It fixed the problem in VS 2012. Don't know about VS2010 though.

这篇关于无法获取的Web API在VS 2010或2012年工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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