2

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'.

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.

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.

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.

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.

Fabis
  • 1,932
  • 2
  • 20
  • 37
  • I'd say that the best bet you can get is to stick with command line tools and use `dnu build` instead of Visual Studio tooling. If you use scaffolding much you may consider reinstalling VS tooling for beta8 from http://www.microsoft.com/en-us/download/details.aspx?id=49442 if you haven't already (it's fresh and warm still). It is surely possible to create working Web Application on ASP.NET 5 - but it is sometimes hard to figure out all the answers. Still - I cannot determine what is your exact problem so I can not post an answer. – pg0xC Oct 15 '15 at 20:35
  • The problem is that when I create a Web Api project with VS2015 I can't run it on any version above beta5, because the dependencies (libraries) defined in project.json are older versions and I have no idea which versions of those libraries are supposed to work with which ASP.NET 5 releases. I've tried updating them, but I've gotten strange exceptions when running the build for which I couldn't find anything in Google. – Fabis Oct 15 '15 at 21:03

1 Answers1

2

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"
},

EDIT: 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"
},

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).

version checking for web tools

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

pg0xC
  • 1,226
  • 10
  • 20
  • 1
    That seems to have fixed it! I didn't even know Microsoft offered updated tooling for each beta version, because there isn't really a comprehensive guide for this out there yet, or at least I couldn't find one. – Fabis Oct 15 '15 at 21:46