获取用于.NET网页API的依赖正确的最新的.NET核心 [英] Getting the correct dependencies for .NET Web Api for the latest .NET core

查看:238
本文介绍了获取用于.NET网页API的依赖正确的最新的.NET核心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想在某种程度上,它可以在Linux以及(使用.NET的核心)创建的ASP.NET Web API项目。当我创建在Visual Studio中一个新的Web API项目,它看起来像它使用的依赖关系和code脚手架从回来时,ASP.NET 5在beta5的,到目前为止,我已经得到了它的工作,如果我使用beta5的版本DNX与'DNX网运行它。

So I'm trying to create a ASP.NET Web Api project in a way that it works on Linux as well (using .NET Core). When I create a new Web Api project in Visual Studio, it looks like it uses dependencies and code scaffolding from back when ASP.NET 5 was in beta5 and so far I've gotten it to work, if I use the beta5 version in DNX to run it with 'dnx web'.

问题是,我想使用最新的RC1版或至少beta8,我可以得到ASP.NET与dnvm的版本,但Visual Studio中仍使用较早的依赖和脚手架创建项目。

The problem is that I'm trying to use the latest rc1 version or at least beta8 and I can get those versions of ASP.NET with 'dnvm', but Visual Studio still creates projects using the older dependencies and scaffolding.

我甚至不能告诉是什么版本的,我应该更新他们,因为有比beta8高不断有新的pre-发行版本,如果我只是一切都更新到最新版本,那么没有什么工作 - 我无法运行它与'DNX网络',因为我得到某种怪异的异常。

I can't even tell what version should I update them to because there are constantly new pre-release versions higher than beta8 and if I just update everything to the latest version then nothing works - I can't run it with 'dnx web' because I get some sort of weird exception.

那么,有没有办法告诉 - 我应该ASP.NET 5的版本有什么用什么版本的依赖关系?而且同样适用于code,因为很明显的默认脚手架code甚至不与最新版本的工作,由于缺少被一些方法。

So is there a way to tell - what versions of dependencies should I use with what versions of ASP.NET 5? And same goes for code, because apparently the default scaffolded code doesn't even work with the latest versions due to some methods being missing.

它甚至有可能现在就创建在.NET的核心工作Web应用程序?因为ASP.NET 5即将发布,所以我认为这是可行的好吗通过这一点。

Is it even possible to create a working Web Application on the .NET Core right now? Because ASP.NET 5 is about to be released, so I would think that it would work alright by this point.

推荐答案

这是什么ASP.NET和Web Tools 2015年(同β7)不适合我。我想beta8( http://www.microsoft.com/en -us /下载/ details.aspx?ID = 49442 )将脚手架beta8包。

This is what ASP.NET and Web Tools 2015 (Beta7) does for me. I suppose beta8 (http://www.microsoft.com/en-us/download/details.aspx?id=49442) will scaffold beta8 packages.

"dependencies": {
 "EntityFramework.Commands": "7.0.0-beta7",
 "EntityFramework.SqlServer": "7.0.0-beta7",
 "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta7",
 "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta7",
 "Microsoft.AspNet.Authentication.Google": "1.0.0-beta7",
 "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta7",
 "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta7",
 "Microsoft.AspNet.Diagnostics": "1.0.0-beta7",
 "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta7",
 "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta7",
 "Microsoft.AspNet.Mvc": "6.0.0-beta7",
 "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta7",
 "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
 "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
 "Microsoft.AspNet.StaticFiles": "1.0.0-beta7",
 "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta7",
 "Microsoft.Framework.Configuration.Abstractions": "1.0.0-beta7",
 "Microsoft.Framework.Configuration.Json": "1.0.0-beta7",
 "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta7",
 "Microsoft.Framework.Logging": "1.0.0-beta7",
 "Microsoft.Framework.Logging.Console": "1.0.0-beta7",
 "Microsoft.Framework.Logging.Debug" : "1.0.0-beta7",
 "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta7"
},

编辑:对于这的WebAPI是:

For WebAPI this is:

"dependencies": {
  "Microsoft.AspNet.Mvc": "6.0.0-beta7",
  "Microsoft.AspNet.Server.IIS": "1.0.0-beta7",
  "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7",
  "Microsoft.AspNet.StaticFiles": "1.0.0-beta7"
},

最可能的是你有老版VS工装。你可以检查你的ASP.NET和Web Tools版本下有关Visual Studio中的帮助菜单。重新安装或从构建系统或运行时(包括IIS)后得到确切的消息。

Most probably you have old version of VS tooling. You may check your version of ASP.NET and Web Tools under About Visual Studio in Help menu. Reinstall or post exact message you get from build system or from runtime (including IIS).

版本的网络工具检查

编辑:忘了提,是DNX同β7对我的作品(DNX beta8与同β7VS工具没有)

forgot to mention that is works for me for dnx beta7 (dnx beta8 with beta7 VS tooling does not)

这篇关于获取用于.NET网页API的依赖正确的最新的.NET核心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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