asp.net-core-1.0

Does ASP.Net Core 1.0 support WebForm projects

狂风中的少年 提交于 2019-12-17 10:54:14
问题 Does ASP.Net Core 1.0 support .Net WebForm projects? Or it is an MVC only environment? Also can I create classic web services(asmx) there? 回答1: Short answer: No, ASP.NET Core does not contain Web Forms or Web Services. Long answer: Depends on your meaning of "support". If you aim to run ASP.NET Core project on top of CoreCLR and CoreFX , then the answer is no: ASP.NET Core will contain support only for MVC ja Web API -projects (which are the same thing in ASP.NET Core). If you can run on full

Access Web.config settings in Asp.Net Core App?

拥有回忆 提交于 2019-12-17 10:47:49
问题 I understand that asp.net core has a new configuration system that is quite flexible and that's great. But there are things I like about the web.config based configuration system from .net 4.x. For example one can put comments in the web.config file since it's an xml file. And that for me is worth sticking with xml rather than going with the shiny new json approach. [ Update: I now understand that the json approach also supports comments in the file.] So, if I have a Asp.Net Core Web Project

How to read connection string in .NET Core?

梦想的初衷 提交于 2019-12-17 04:49:29
问题 I want to read just a connection string from a configuration file and for this add a file with the name "appsettings.json" to my project and add this content on it: { "ConnectionStrings": { "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet- WebApplica71d622;Trusted_Connection=True;MultipleActiveResultSets=true" }, "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" } } } On ASP.NET I used this: var temp

DIRECT replacement of UserHostAddress in ASP.NET Core?

自闭症网瘾萝莉.ら 提交于 2019-12-14 01:51:24
问题 We discovered that Request.UserHostAddress is not available in ASP.NET Core (1.0 RC1), as well as Request.ServerVariables["REMOTE_ADDR"] , which returns essentially the same. Now we found HttpContext.Connection.RemoteIpAddress or HttpContext.Features.Get<IHttpConnectionFeature>()?.RemoteIpAddress to be the replacement, but is it really a 1:1 replacement for the functionality? What I mean: Request.ServerVariables["REMOTE_ADDR"] only returns the direct IP address of a caller, not a forwarded

Akka.net asp.net 5 mvc 6 configuration for Hocon

假装没事ソ 提交于 2019-12-13 16:12:47
问题 I am currently trying to use akka.net but the configuration they use HOCON is a different syntax from the json syntax normally used in app.json when configuring our app. Does anyone know how to use HOCON with the current app.json configuration? 回答1: I use ConfigurationFactory.FromObject and some classes that has the properties that I'm interested in to read the akka-config from appsettings. var config = ConfigurationFactory.FromObject(new { akka = configuration.GetSection("Akka").Get

Configuring Nunit with ASP.NET MVC Core 1.0

青春壹個敷衍的年華 提交于 2019-12-13 08:24:38
问题 I wanted to configure NUnit for my ASP.NET Core 1.0 project. I have tried following : http://www.alteridem.net/2015/11/04/testing-net-core-using-nunit-3/ , but it's there for console applications. If I try to attach a new project (class library) to my solution and then try to reference my original project - it gives me reference error. Here is what worked for me: I attached another web app project, dedicated to writing tests, to my original project, as opposed to the console library project.

Alternative to System.Web.Security.Membership.GeneratePassword in aspnetcore (netcoreapp1.0)

若如初见. 提交于 2019-12-12 10:28:49
问题 Is there any alternative to System.Web.Security.Membership.GeneratePassword in AspNetCore ( netcoreapp1.0 ). The easiest way would be to just use a Guid.NewGuid().ToString("n") which is long enough to be worthy of a password but it's not fully random. 回答1: Here's a class/method, based on the source of Membership.GeneratePassword of that works on .NET Core: public static class Password { private static readonly char[] Punctuations = "!@#$%^&*()_-+=[{]};:>|./?".ToCharArray(); public static

Why publishing to IIS is change for ASP.net core ?

守給你的承諾、 提交于 2019-12-12 03:44:18
问题 When I publish under Visual Studio 2015 CTP 5 then I don't have to do setting for application pool CLR version. Now for ASP.net core application and as per documentation ( http://docs.asp.net/en/latest/publishing/iis.html ) we have to do setting for application pool clr to No managed code. Why it is like that ? 回答1: ASP.NET Core applications no longer run inside IIS but run out-of-process and IIS acts only as a reverse proxy. This functionality is provided by the AspNetCoreModule which is a

asp.net5 selfhosted WebListener connection timeout

有些话、适合烂在心里 提交于 2019-12-12 03:28:00
问题 I am using asp.net5 web project hosted in console app. It works fine on localhost, but when i try to access this website form different machine like http://192.168.1.5:5432 etc., i get ERR_CONNECTION_TIMED_OUT . I was trying several arouches like chaning localhost to machine name but none of them works. hosting.ini file: server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5432 Is there any solution for this problem, or hosting in console app is only made for development

empty model submitted from the form

▼魔方 西西 提交于 2019-12-12 02:18:25
问题 I'm using the latest preview of Asp.Net Core. I have a page with pretty simple edit form and some additional data displayed. @model SeasonFullDetailsViewModel ..... <form asp-action="Save"> <div class="form-horizontal"> <hr /> <div asp-validation-summary="ModelOnly" class="text-danger"></div> <input type="hidden" asp-for="SeasonId" /> <div class="form-group"> <label asp-for="Season" class="col-md-2 control-label"></label> <div class="col-md-10"> <input asp-for="Season" class="form-control" />