I try to get an asp.Net 5 mvc running under mono. For the first steps i try to run an Application Template from yo My Steps are :
yo aspnet
<- choose WebApplication with name MyWeb
cd MyWeb
kpm restore --source https://www.myget.org/F/aspnetvnext/api/v2/
<- done without errors
kpm build
after that command i got the following errors:
/home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(29,16): error CS0246: The type or namespace name 'IConfiguration' could not be found (are you missing a using directive or an assembly reference?) /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(32,39): error CS0246: The type or namespace name 'IServiceCollection' could not be found (are you missing a using directive or an assembly reference?) /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(59,56): error CS0246: The type or namespace name 'IHostingEnvironment' could not be found (are you missing a using directive or an assembly reference?) /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(59,81): error CS0246: The type or namespace name 'ILoggerFactory' could not be found (are you missing a using directive or an assembly reference?) /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(21,24): error CS0246: The type or namespace name 'IHostingEnvironment' could not be found (are you missing a using directive or an assembly reference?) /home/dev/WORKSPACE/MyWeb/MyWeb/Models/IdentityModels.cs(21,37): error CS0246: The type or namespace name 'IHostingEnvironment' could not be found (are you missing a using directive or an assembly reference?) /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(24,29): error CS0012: The type 'IConfigurationSourceContainer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.ConfigurationModel.IConfigurationSourceContainer, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(40,17): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.DependencyInjection.IServiceCollection, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(46,13): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.DependencyInjection.IServiceCollection, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(50,13): error CS0012: The type 'IServiceCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.DependencyInjection.IServiceCollection, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. /home/dev/WORKSPACE/MyWeb/MyWeb/Startup.cs(63,13): error CS0012: The type 'ILoggerFactory' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Framework.Logging.ILoggerFactory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
this is my project.json:
{
/* Click to learn more about project.json http://go.microsoft.com/fwlink/?LinkID=517074 */
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.SqlServer": "7.0.0-beta3",
"EntityFramework.Commands": "7.0.0-beta3",
"Microsoft.AspNet.Mvc": "6.0.0-beta3",
/* "Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-beta3", */
"Microsoft.AspNet.Diagnostics": "1.0.0-beta3",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta3",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta3",
"Microsoft.AspNet.Security.Cookies": "1.0.0-beta3",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta3",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta3",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta3",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta3",
"Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta3",
"Microsoft.Framework.Logging": "1.0.0-beta3",
"Microsoft.Framework.Logging.Console": "1.0.0-beta3",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta3",
/* Modifications for Mono Support*/
"EntityFramework.InMemory": "7.0.0-beta3",
"Kestrel": "1.0.0-beta3"
},
"commands": {
/* Change the port number when you are self hosting this application */
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004",
"gen": "Microsoft.Framework.CodeGeneration",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"aspnet50": {},
"aspnetcore50": {}
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"bundleExclude": [
"node_modules",
"bower_components",
"**.kproj",
"**.user",
"**.vspscc"
],
"scripts": {
"postrestore": ["npm install"],
"prepare": ["grunt bower:install"]
}
}
Used Versions are: Mono JIT compiler version 3.12.0 (tarball Sat Feb 7 19:13:43 UTC 2015) KRE: 1.0.0-beta4-11166
Seems like something is wrong with Microsoft.Framework.ConfigurationModel but running out of ideas how to fix this. I hope someone can give me an hint to point me in the right direction!
Thanks a lot for reading! Regards Alex