asp.net-core-mvc

AWS Cognito User Pools and OpenId

不想你离开。 提交于 2020-01-03 14:08:47
问题 I am playing around with Amazon Cognito and after reading some of the docs and creating a user pool I am running into some issues. I believe that a cognito user pool can be used with OpenId to redirect the user to a hosted UI for user authentication (without federating out to another provider). I have tried to use the authentication options in DotNetCore 2 to do this as this is something I have done previous with other providers. I have the following: services.AddAuthentication(options => {

.NET Core 2.x how to get the current active local network IPv4 address?

这一生的挚爱 提交于 2020-01-03 10:56:27
问题 On which is running the WebService. Like the one I can get in cmd.exe > ipconfig : What I would like to achieve is automatic IP configuration of Kestrel, like: .UseKestrel(opts => { opts.Listen(/*LocalIPv4ActiveAddress*/, 5000); }) So I can switch my development machines with different active network interfaces (WiFi || Ethernet) and different local network IP addresses. 回答1: You can try something like this: // order interfaces by speed and filter out down and loopback // take first of the

.NET Core SDK Installer failed to install on windows 2012 R2 Standard

北城余情 提交于 2020-01-03 10:22:30
问题 I setting up my build server for CI using Jenkins. I am trying to install .NET Core SDK from https://www.microsoft.com/net/download However i tried executing downloaded DotNetCore.1.0.1-SDK.1.0.0.Preview2-003131-x64.exe i get unspecified error and here is complete log [07E8:0FE4][2016-09-19T12:09:36]i001: Burn v3.10.2.2516, Windows v6.3 (Build 9600: Service Pack 0), path: C:\Users\CODESC~1\AppData\Local\Temp\3\{0D7DA4AD-993A-4038-A544-14369A3FAF40}\.cr\DotNetCore.1.0.1-SDK.1.0.0.Preview2

How to confirm a phone number in ASP.Net Core 1.1MVC

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 09:16:10
问题 I cannot figure out how to do a phone number confirmation in asp.net core 1.1 Identity service configuration contains explicit options to require confirmed email and/or phone number. It can be done the following way: services .AddIdentity<User, Role>(options => { options.SignIn.RequireConfirmedEmail = true; options.SignIn.RequireConfirmedPhoneNumber = true; }); The validation of the email is quite straight forward as the UserManager contains explicit token generator and its validator: var

Observable errors with Angular2 beta.12 and RxJs 5 beta.3

北慕城南 提交于 2020-01-03 08:53:12
问题 Hello, I am using Angular2 beta 12 running in VS2015. When I update to rxjs from 5.0.0-beta.2 to beta.3 I encounter a range of exceptions generally relating to my promises. E.g. Property map does not exist on type Observable<Response> Property share does not exist in type Observable<Response> Ambient modules declaration cannot specify relative module name Ambient modules cannot be nested in other modules or namespaces. Package.json { "name": "ASP.NET", "version": "0.0.0", "scripts": { "tsc":

Session Store IQueryable in HttpContext

不羁的心 提交于 2020-01-03 03:05:22
问题 I am migrating project from Net MVC to MVC Core 2. How do I set IQueryable in Sessions? In Net MVC it was the following, public ActionResult CurrentOwners_Read([DataSourceRequest]DataSourceRequest request, int propertyID) { if (propertyID == 0) { throw new ArgumentNullException("propertyID"); } IQueryable<PropertyOwnerRoleViewModel> allResult = (IQueryable<PropertyOwnerRoleViewModel>)HttpContext.Session.GetString(_currentOwnersResult).AsQueryable(); if (allResult == null) {

Session Store IQueryable in HttpContext

孤者浪人 提交于 2020-01-03 03:05:16
问题 I am migrating project from Net MVC to MVC Core 2. How do I set IQueryable in Sessions? In Net MVC it was the following, public ActionResult CurrentOwners_Read([DataSourceRequest]DataSourceRequest request, int propertyID) { if (propertyID == 0) { throw new ArgumentNullException("propertyID"); } IQueryable<PropertyOwnerRoleViewModel> allResult = (IQueryable<PropertyOwnerRoleViewModel>)HttpContext.Session.GetString(_currentOwnersResult).AsQueryable(); if (allResult == null) {

Asp.Net MVC Core 1.0 - anchor tag helper with an empty area

旧时模样 提交于 2020-01-02 23:51:53
问题 I have an area called Admin, in one of my pages in this area, I want to navigate to the views that are located outside of my area, in fact it isn't in any area, with HTML helpers I could pass empty for that like so: @Html.ActionLink(item.ArticleTitle, "Details", new { id = item.ArticleId,title=item.ArticleTitle.Replace(' ', '-'), Area = "" }) But when using tag helper, passing empty doesn't work: <a asp-action="Details" asp-route-area="" asp-route-id="@item.ArticleId" asp-route-title="@item

Problems running/configure self hosted console application (ASP.net core 2.1, Kestrel) with public certificate on a windows webserver

≡放荡痞女 提交于 2020-01-02 17:54:07
问题 I have developed various webservices in the past (VB ASP.net web-api applications) with https for production. I have done the development with http and then setup https on the production servers. To setup a port on the production server for https and the certificate, I have: Imported a public certificate in the certificate store on the windows server configured a specific port for https with netsh. E.g: netsh http add urlacl url=https://+:22224/ user=everyone bound the certificate (over the

Not able to use XUnit for unit tests in ASP.NET VNext and Visual Studio 2015 RC

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-02 16:08:37
问题 I created a a Visual Studio 2015 RC solution as follows: Project global.json Source MvcProject MvcProject.Test MvcProject.Test is a class library where I created a Test. The global.json file has the following: { "projects": [ "Source" ], "sdk": { "version": "1.0.0-beta4" } } And project.json in MvcProject.Test is: { "compilationOptions": { "warningsAsErrors": true }, "dependencies": { "Microsoft.AspNet.Mvc": "6.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "commands": { "test": "xunit