Questions tagged [asp.net-core-1.1]
Use this tag for questions specifically related to ASP.NET Core 1.1, in addition to using the 'ASP.NET Core' tag.
298
questions
0
votes
0
answers
251
views
Problem using variables and relative paths in Visual studio 2019 (publish profile)
I have imported an old Visual studio 2015 application to Visual studio 2019. I converted everything so it works, execpt one thing. I can't get relative path or environment variables to work in publish ...
2
votes
1
answer
1k
views
How to remove cookies ai_user ai_session completely from client side app insights
_Layout.cshtml
@inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet
<!DOCTYPE html>
<html>
<head>
@Html.Raw(JavaScriptSnippet.FullScript)
</...
0
votes
0
answers
31
views
AspNet Core Identity, how set options.Cookie.SameSite for .net core 1.1
I am facing issue with same site cookie policy in chrome, application is built using .NET core 1.1 version, is there any workaround to fix cookies same site issue in .NET core without updating the ....
0
votes
1
answer
134
views
Equivalent to BindPropertyAttribute in ASP.NET Core 1.1
Due to limitations imposed by a hosting provider, I am forced to use ASP.NET Core 1.1.
I have created a model class and wish to have that model bind to a named value that is different to the name of ...
2
votes
1
answer
480
views
IdentityServer and Simple Injector integration in ASP.NET Core v1.1
We use Simple Injector for our application components and we need to access a component inside of an IdentityServer interface implementation (IResourceOwnerPasswordValidator), which itself is inside ...
0
votes
2
answers
2k
views
Custom model binder not retrieving value from value-provider
I have a Custom model binder that will convert posted values to another model.
Issue is bindingContext.ValueProvider.GetValue(modelName) returns none even if there are values posted from client.
...
0
votes
2
answers
495
views
Unit Testing custom eager validation on top of lazy validation from IOptions .NET Core 1.1 and up
This is not a question but a case study that was tried on by me where questions have not been asked. In case anyone else tries this kind of idiotic unit testing in the future, these are my findings:
...
0
votes
1
answer
305
views
How to clear cacheKey in separate instance of IMemoryCache
I'm running on ASP.NET Core 1.1 where in my Startup.cs I configure Policies, as well as DistributedMemoryCache, like this:
var roleRepo = new RoleRepo(Configuration, new MemoryCache(new ...
0
votes
0
answers
111
views
Duplicate type name within an assembly in .Net Core 1.1
I am getting the this error every now and then and not exactly pin point what the issue is
I am using .NET Core 1.1 API
System.ArgumentException: Duplicate type name within an assembly.
at ...
2
votes
1
answer
5k
views
Command Update-Database -Context "IdentityDbContext" Doesn't Create Tables
I have a previous created project from "ASP.NET Core: Security" LinkedIn Learn Course (https://1drv.ms/u/s!Ap1TSQ4qoVyxgrImtb6ZFwZXQGW2BA) and in this project already exists the Migrations Migrations ...
0
votes
1
answer
29
views
When exception is being hit in Visual Studio debugging, hovering the exception reveals null
For some reason, when attempting to debug an application, the exceptions themselves show as null. Initially, I didn't have the SqlException catch section, but I did see that it said it had thrown a ...
0
votes
1
answer
254
views
Logged user based connection string in .NET Core
I have an application that uses identity database to store users and customers.
Each customer has also a separate database with its data and its connection string is stored in Customer table in the ...
8
votes
2
answers
1k
views
Override default indexes in AspNetCore.Identity tables
I'm developing a multi-tenant application in ASP.NET Core 2.1. I'm utilizing AspNetCore.Identity.EntityFrameworkCore framework for user management. I want to add a unique index combining ...
1
vote
1
answer
2k
views
Add additional claims on TokenValidated event
In my ASP.NET Core 1.1 application I'm using JWT tokens for authentication.
Under certain conditions I need to add additional claims to the user which are not provided in the token.
So I hooked into ...
0
votes
0
answers
369
views
Unable to customize .net core CSRF Cookie Path
In order to be compliant with a security Audit , we need to change the path of the cookies created in our Asp.net core website on dotnet core 1.1
As per my understanding the Antiforgery middleware is ...
1
vote
1
answer
428
views
Asp.net Core 1.1 HttpGet FromQuery complex model binding not working
Having this model:
public class PagingParameters
{
public int PageIndex { get; set; }
public int PageSize { get; set; }
}
Using the following controller action:
[HttpGet]
public object ...
1
vote
1
answer
86
views
Can I programatically check whether a user is authorized for a given controller method?
[Please note this question is about DotNet Core 1.1]
I have a controller method in my ItemsController class attributed as follows to restrict the ability to access the method to users in an ...
2
votes
1
answer
700
views
How to check if one HTTP client is still connected to the server in asp.net core?
I wanna know if there is a way to check if one client is still connected to asp.net core server?
If I understand well, in the standard asp.net we can do this using this property, and I'm asking if ...
1
vote
0
answers
54
views
Log Trace.WriteLine in Azure
Our team has an ASP.NET Core Web Application which integrates Multisafepay payment provider (MSP). We use the .NET wrapper of MSP to communicate with the API of the payment provider. In some cases ...
0
votes
1
answer
1k
views
Are we supposed to delete migration snapshot when migrating db to .NET Core 2
If we have existing database migrations and a snapshot file in our .NET Core 1 project, are we supposed to delete the snapshot in .Net Core 2 before we do a new migration?
EDIT:
I noticed the ...
1
vote
0
answers
104
views
TCP CLOSE_WAIT apple apns
We are currently on asp.NET Core 1.1.4
The ApnsStream.AuthenticateAsClientAsync() never returns. We tried using netstat and the connection shows up as CLOSE_WAIT. We also verified that the certificate ...
1
vote
1
answer
839
views
Can we publish an existing github repo as nuget package?
I would like to use this library:
https://github.com/geeklearningio/PushSharp-Core
But I have no idea how turn this into nuget package or to include it in my existing .NET Core 1.1 app. I need to ...
0
votes
3
answers
7k
views
Bind TextBox Controls From Autocomplete TextBox Using ASP.Net core mvc Visual Studio 2017
I'm working on a asp.net core 1.1 project using EF Core.
Starting from a text inserted in a Textbox on my Create.cshtml page (where I use autocomplete function) I want to bind other textbox controls ...
0
votes
2
answers
4k
views
update multiple tables in one go in EF dbcontext
I haven't encountered any where in EF examples, but is it safe to update multiple tables in one go as below
using(var db = new MyDbContext(opts))
{
var record = db.Record.FirstOrDefault(x => x....
1
vote
0
answers
145
views
asp.net core 1.1 reading streamcontent multipart data
How do I split a multipart data received from webex file download service
HttpResponseMessage resp;
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("SOAPAction", "...
1
vote
0
answers
516
views
How to catch exception thrown by IEnumerable outside of my code
I have encountered an issue with aspnet core mvc error handling. I have properly set up exception handling in my startup code (it works when exceptions are thrown while executing code within ...
0
votes
0
answers
38
views
TagHelpers not being processed in views other than _Layout
I load a page and when I use a custom Layout it appears that the _ViewImports file may not being applied. Not sure how to troubleshoot this. If I set Layout = _Layout, the asp- tags work just fine (...
1
vote
4
answers
15k
views
How to download file in asp.net core
My download method is
public async Task<IActionResult> Download(string filename)
{
if (filename == null)
return Content("filename not present");
...
2
votes
1
answer
4k
views
C# ASP.Net Core facing issues when integrating with Autofac
I have a controller DailyExpenseController and I am injecting the IQueryExecutor class into the controller.
DailyExpenseController
using HomeBudgetTrackingSystem.CrossCutting;
using ...
0
votes
1
answer
649
views
Getting System.InvalidOperationException in nested method evan after calling the BeginTransaction
I have a method like below code. I pass a SqlConnection and a Transaction to the nested methods.
public async Task<IdentityResult> M(Model model, CancellationToken cancellationToken,
...
1
vote
0
answers
1k
views
Minifying issue in ASP.NET Core application
In asp.net core application I have bundleconfig.json file like below
[
{
"outputFileName": "wwwroot/css/site.min.css",
"inputFiles": [
"wwwroot/css/site.css"
]
},
{
"...
4
votes
0
answers
3k
views
How to return large Json in Asp.Net Core
In classic asp.net in order to return large json data i enable it web.config
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization ...
0
votes
1
answer
48
views
Mvc view is not getting refreshed in Asp.net mvc core 1.1
I am developing an MVC web application using Asp.net core 1.1 . In view i am creating grid by looping the div's.
@foreach (var eachItem in Model.PageProjects)
{
<div class="...
0
votes
1
answer
1k
views
Custom authentication middleware: InvalidOperationException on failed authentication
I want to authenticate calls to my ASP.NET Core 1.0 application using a HTTP Header like Authorization ToggledKey 10079a4c-d27e-4898-915a-968850c756ef
The idea being that I can issue API keys and ...
0
votes
1
answer
195
views
Detect requstURI dynamically + ASP.NET Core
I'm using web.config to set up some rediretion rules using .Net Core.
<rule name="About Page" stopProcessing="true">
<match url="about.aspx" />
<action type="Redirect" url="...
0
votes
1
answer
4k
views
Detect URL redirection + ASP.NET Core
I'm trying to redirect webform urls to .net core.
Lets say user entered www.test.com/index.aspx in URL, it will redirect to www.test.com/home/index
So in the HomeController, IActionResult Index ...
2
votes
2
answers
7k
views
How to get Docker IP in windows Container?
I unable to get container IP address to run it from Browser.
Code Snippet
PS H:\DevAreaLocal\COMPANY - RAD PROJECTS\DockerApp\WebDockerCoreApp> docker-compose build
Building webdockercoreapp
...
2
votes
2
answers
1k
views
How to set required claims for IdentityServer4 API Resources?
I am using IdentityServer4 1.0.0 with the configuration information for the clients and API resources stored in SQL Server using the IdentityServer4.EntityFramework 1.0.0 package.
Is there a way to ...
5
votes
2
answers
2k
views
Recommended identity / user for Kestrel + .NET Core (Windows)
When using Kestrel with IIS you define an Application Pool and identity (user). The default identity is "ApplicationPoolIdentity" but can be one of the following or a custom user:
When the ...
0
votes
1
answer
1k
views
EF - Migrations on Code First: A database operation failed while processing the request
I published ASP.NET MVC Core 1.1.1 project to production along with its SQL Server 2012 db. After a few days, I backed up and restored the db from production server to development machine and ...
1
vote
1
answer
381
views
How to configure deployment of asp.net core website?
I need to publish my website with a particular web.config for each environment in order to set the environnement variable ASPNETCORE_ENVIRONMENT to "Development" or "Production".
This could be ...
-1
votes
2
answers
2k
views
visual studio 2017 remote debugging azure api app: "The breakpoint will not currently be hit. No symbols have been loaded for this document."
I'm trying to remote debug an asp.net core 1.1 api app (targeting .net framework 4.5.2) that's running on Azure.
I attach the debugger via Server Explorer. The debugger attaches to the correct process....
0
votes
0
answers
953
views
Is it support .NET Core Windows Server Hosting bundle 2.0 for .NET Core 1.0 app
Steps taken:
Environment: IIS 7.5 , Visual studio 2015 update 3, Install .NET Core Windows Server Hosting bundle,configured in machine ,and gave permission for publish folder,and changed to .net ...
0
votes
0
answers
484
views
How to do IIS HOSTING WITH ASP.NET CORE 1.0.3 with angular2 application
I have created an asp.net core 1.0 project with angular in visual studio 2015 update 3 and I am new to .net core hosting , the project is running in local machine and when i published the .net core ...
0
votes
1
answer
252
views
asp.net mvc + detect hashtag change
When I try to detect hashtag change in url, for example:
http://localhost:54345/Shop/Catalog?cg=9#3221
to
http://localhost:54345/Shop/Product#1241
Jquery hashchange method does not fire.
$(window)...
7
votes
1
answer
5k
views
Downloading byte[] of generated pdf using nodeservices in Asp.net Core 1.1
I'm trying to download a nodeServices generated pdf file that is in the form of byte array. here is my original code:
[HttpGet]
[Route("[action]/{appId}")]
public async Task<IActionResult> Pdf(...
1
vote
1
answer
172
views
JetBrains Rider IDE - Is debugging .Net Core 1.1.X possible?
I am currently developing an API using .NET Core 1.1.1 using the JetBrains Rider 2017.1 IDE.
When trying to run the program, I encounter the following error:
"Failed to start debugging session. Try ...
0
votes
0
answers
574
views
How to Install Visual studio 2015 with ASP.NET Core Template?
Am little confused about Installing visual studio 2015 with ASP.NET core template? Firstly I install Visual Studio 15 and install Asp.net core 1.0.1 SDK but ASP.net core template missing in visual ...
0
votes
1
answer
416
views
How to use Code First Migrations When Domain Models in Separate Project from WebUI?
I have a VS 2017 solution with 2 .Net Core 1.1 projects, 1 is just a class library containing all of my domain models and the other is the actual MVC web application containing the contexts (the ...
1
vote
1
answer
160
views
WebApi: Get api/Record/id/Tags
In my ASP.NET MVC (6) web Web Api I have
[Produces("application/json")]
[Route("api/Record")]
public class RecordController : Controller
{
// ...
// GET: api/Record/5
[HttpGet("{id}", ...