Questions tagged [core]

46255 questions
1

votes
0

answer
6

Views

change entity framework core code first migration name format

ef core using system calendar format for generating migration names. example of standard migration name for the Gregorian calendar on windows: 20190206144020_MIGRATION-NAME But if the date format of Windows is something other than the Gregorian, like Persian calendar the ef core migration name gene...
AliReza
1

votes
1

answer
100

Views

Find nearest number in Core Data without iterating over data

I know it's currently not possible to find the nearest geo-location in Core Data without loading all data and doing it manually in code, but is it at least doable with simple numbers? Can I, for example, have a table with entries, with the values 1, 2.5, 4, I search for 3.6 and get back the entry wi...
Jan
1

votes
1

answer
3.1k

Views

Connection ID required

I am trying to build a simple chat application using SignalR with ASP.NET Core 2.0. The problem is that when I want to access one of my hub's url (localhost:5000/chat) I receive as a response: Connection ID required with error code 400. I am using auto generated from template authentication (users...
Georgi Stoimenov
1

votes
1

answer
244

Views

`UIBezierPath.fill()` does not fill inside of `draw()`

I'm cutting a rectangle out of a semi-transparent UIView. When I use UIRectFill() it works as expected. However when I create a UIBezierPath with rounded corners, fill() does not seem to do anything. Oddly, calling stroke() on that same path works fine. WORKS: override func draw(_ rect: CGRect) { s...
rob
1

votes
2

answer
376

Views

Dynamically return fields from a web method

I have a WebAPI service where I would like to allow users to specify which fields they'd like returned. For example, say I have the following Person class: public class Person { public string FirstName { get; set; } public string LastName { get; set; } public string Email { get; set; } } and that ca...
Phillip Copley
1

votes
3

answer
4.5k

Views

.net core cross platform desktop app

I'd like to develop a cross platform desktop app by using .net Core. The app needs to be executed on linux, mac os, and windows. For that purpose, should i create a console app and put below lines in settings xml? win10-x64;osx.10.12-x64;debian.8-x64 Will it be sufficient? If so, should i write all...
Dilara Albayrak
1

votes
1

answer
739

Views

Enable file logging on IIS for serilog

I want to enable file logging on IIS to resolve an issue locally on IIS. Following is the code I am using. It works when I run on visual studio and logs to a file but not when I deployed to IIS. Folder has enough permission to create a file and also I created the folder and file. What am I missing h...
Charith
1

votes
1

answer
1.4k

Views

Will MSBuild support .Net Core Projects

I've been researching for a while now. Unfortunately all sources I read are outdated. Anyone knows if MSBuild plans to support .Net Core Applicatoins? And is there a other Build Engine which Supports it?
1

votes
1

answer
951

Views

How to create a Azure Function, Function Key when your functions are set to Readonly

Summary: I'm authoring a function directly in Visual Studio which by design results in readonly function management in the portal. My question is how does one easily create a function key for said webhook? Context: I'm trying to hook up a generic webhook to Event Grid. This process has led me down...
ThatCreole
1

votes
1

answer
1.8k

Views

Generate Razor HTML emails in dotnet core 2

How can you generate emails (html) using Razor in dotnetcore - and not from an MVC app (think from a console app)? RazorEngine does a great job in .net 4.x, but is not working in dotnet core. RazorEngineLight works in dotnet core 1.x, but not in 2.x. Some other options are mentioned in this post: Us...
Kjensen
1

votes
1

answer
457

Views

.NET Core calls to Encoding.GetEncoding() hang

I'm calling the lines below. The calls hang infinitely. Encoding.GetEncoding(1251); Encoding.GetEncoding('Windows-1251'); I'm using: VS 2017 15.7.2 dotnet --version > '2.1.201' Windows 10
f0rt
1

votes
2

answer
1.1k

Views

how to offline install .net core and sdk on linux (RHEL)?

I have to install .net core 2.0 and SDK on Linux machine (RHEL distribution) server, where there is NO internet connectivity. Any help on instructions would be appreciated.
Kushhh Alll
1

votes
1

answer
238

Views

Cannot Scaffold (EF, Core 2.1) model that contains a 'bool' item

My model looks like this: namespace Flow.Models { public abstract class Project { public int ID { get; set; } public String HashID { get; set; } public string FileLoc { get; set; } //Use HashedID above. public bool Network { get; set; } public int ClientID { get; set; } public int FirmID { get;...
user1489765
1

votes
2

answer
928

Views

Changing B2C Reply URL from “signin-oidc” to something else does not work

I am trying to get a ASP.NET Core 2.1 web app running with Azure AD B2C. I have this running after much reseach (and more trial and error) as the instructions found in the docs are a little off. The sign-in/sign-up process works using the default scaffolding during the project setup wizard, plus the...
John
0

votes
0

answer
13

Views

How to bring another project (get,post) api method to swagger api project?

I've created one API project with asp.net core in which I used swashbuckle.AspNetCore dll to generate swagger. It is working perfectly and going well. Now I have another c#(.net standard library) in which I have created some GET, POST, DELETE, PUT method. Need to load all of those methods to the swa...
sk5202
0

votes
0

answer
12

Views

Force inner join from EF Cores Include() on optional relationship

We changed a relationship from required to optional, now the resulting SQL produced by EF Core's Include() does a left outer join rather than inner join. Problem is that those optional entities have query filters on them that is required. Let's say we have the following; public class First { public...
HenrikM
1

votes
0

answer
9

Views

How can change a MYSQL Join Query in Linq Methods

I write a MySql join code, and want to retrive same value from the Dotnetcore linq methods. My Join code is below: SELECT GL.Id AS GradeLevels, CRS.Name AS CourseName, GL.Title AS GradlevelName, AVG (ASTSTU.ObtainedMarks) FROM GradeLevels GL INNER JOIN Courses AS CRS ON CRS.GradeLevelsID = GL.Id IN...
Vipin Jha
1

votes
0

answer
6

Views

Why an exception was thrown while deserializing the token on CentOS 7

why I got this exception ONLY in production environment (CentOS 7)? === [ERR] An exception was thrown while deserializing the token. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted. ---> System.Security.Cryptography.CryptographicExceptio...
Donald
1

votes
0

answer
9

Views

The selector “app-root” did not match any elements after update to Angular 7

After updating the client app of an ASP.Net Core MVC SPA-project from Angular 5.2 to Angular 7, I receive the following runtime error when loading the app from index.html: The selector 'app-root' did not match any elements at DefaultDomRenderer2.push../node_modules/@angular/platform-browser/fesm5/pl...
Marc
1

votes
2

answer
1.9k

Views

How to read connection string inside .NET Standard Class library project from ASP.NET Core

In my solution, I have a ASP.NET Core web project and a .NET Standard class library project. Class library project is the data access layer and I want to read the connection string from my appsettings.json (ASP.NET Core project) in my data access layer. I have found few answers such as by Andrii Li...
Learning Curve
1

votes
1

answer
368

Views

setting scnnode presentation position

I want to set the transform of both a given scn:SCNNode and its current presentation node, to a new value. However, I'm having trouble setting the presentation node. I've tried four ways: Set presentation node's transform: scn.position = newVal scn.presentation.position = newVal scn.pre...
Allen King
1

votes
2

answer
670

Views

Which files to publish? ASP .Net Core 2.0

I'm working on hosting my first ever Asp.net core 2.0 website. To bundle the project I ran 'dotnet publish' This created the following folder structure for publish: /wwwroot /appsettings.Development.json /appsettings.json /ProjectName.deps.json /ProjectName.dll /ProjectName.pdb /ProjectName.PreCompi...
Richard Smith
1

votes
2

answer
192

Views

Options for controlling Destructuring of request object

I've run into a problem that I'm struggling to find a clean solution for, and Googling has not made me any wiser. The situation (1) We have our own assembly for setting up and adding a Serilog logger to any of our projects (consistent logging output, theme, etc) and this assembly has no references t...
Mashton
1

votes
2

answer
188

Views

Is it able to store Firebase user to our own database?

If I use the user registration and login through the firebase authentication, the user information are stored in the firebase database side. How can I get the user information (such as FirstName, LastName, Gender and etc.) and store in my own database? Is it use the access token to call my API to ch...
ZhengJie Tan
1

votes
2

answer
713

Views

HttpContext.Features vs HttpContext.Items In Asp.Net Core

What is the differences between this two Properties? I can use HttpContext.Items instead of HttpContext.Features to share data between middlewares. The only difference i see is that i tell Items for a key and it gives me object and i have to cast it. This casting can be done in Features automaticall...
Mohammad Barbast
1

votes
2

answer
654

Views

ASP.NET Core ViewData, BindProperty or TempData?

In ASP.NET Core Views and Razor Pages we can use: public class LoginModel { [BindProperty] public bool DisplayCaptcha { get; set; } // OR [ViewData] public bool DisplayCaptcha { get; set; } // OR [TempData] public bool DisplayCaptcha { get; set; } } To share data between View/Page/Controller... But...
Vanderlei Pires
1

votes
1

answer
1.8k

Views

My ASP.NET Core app says it can't read web.config

I get this error when I access my app which I published to local IIS: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. My web.config is really simple: What could be wrong? I tried giving all users permissi...
ekolis
1

votes
1

answer
456

Views

asp.net core 2.1 with knockout

I've been trying to teach myself the ins and outs of .NET Core development, and I've got the start of a Core 2.1 web application created. I've even gotten the hang of EF Core, and have a working DB Context. I am, however, having difficulty figuring out how to implement knockout. I ran the command do...
Kurt
1

votes
2

answer
699

Views

asp.net core hosted service sleeps after api inactivity

I have a hosted service that checks an email account every minute. I also am using MVC with Web API 2.1. In order to get my hosted service to start, I have to 'wake it up' by calling API methods. After a period of inactivity from the Web API the hosted service goes to sleep and stops checking the...
Cindy Hoskins
1

votes
1

answer
607

Views

ASP.NET Core Disable CORS for specific controllers

I have different set of controllers in my application (let's say A and B). CORS for A controller needs to be enabled and disabled for B controllers. I have configured CORS via the policies in the following way: ConfigureServices method: services.AddCors( options => { options.AddPolicy( 'AllowCors',...
Pylyp Lebediev
1

votes
1

answer
249

Views

TempData isn't persisting data on Production Server [ASP.NET CORE 2.1]

I have an issue and I have searched the docs to see maybe I made a mistake or something but didn't find the answer that I was looking for. My issue is this, After saving a product, I use the PRG(Post-Redirect-Get) pattern so the user doesn't resubmit the form when pressing the browser back button. I...
umeh oscar
1

votes
1

answer
528

Views

ASP.NET Core: IConfigurationBuilder Does Not Contain Definition For AddAzureKeyVault

I am upgrading my ASP.NET Core web app to .NET Core 2.1, but am getting the following error: IConfigurationBuilder Does Not Contain Definition For AddAzureKeyVault This code works in .NET Core 2.0. It looks like a library is missing in .NET Core 2.1. using System; using Microsoft.AspNetCore; using M...
Brandon Minnick
1

votes
1

answer
223

Views

Override AccountController in Individual User Accounts

I've created in Asp .Net Core 2.1 - mvc Individual User Accounts and add scaffold identity. I need override route Identity/Account/Register to Account/Register. I guess I need access in AccountController and add attr [Route('')]. How can i do it?. In advance thanks for help.
nikita Abramov
1

votes
1

answer
219

Views

How to copy a csproj file using docker without visual studio and without docker compose?

I just started a new solution with a .NET Core Project (2.1) using visual studio 15.8.8. It can run and debug it by setting the docker compose file as a startup project. It works! Logically, I should be able to build the docker image with a simple commandline statement. However, it complains that th...
Daan
1

votes
1

answer
960

Views

How to update appsettings.json based on publish profile using .NET Core?

I'm currently making the switch from .NET Framework to .NET Core. In the past, all of my application settings were in the Web.config file. When I added a new publish profile, I could right click and select 'Add Config Transform' which would generate a nested Web.{Profile}.config file under Web.confi...
Matthew
1

votes
2

answer
98

Views

Inconsistent querying on a partitioned CosmosDB collection

I have a partitioned cosmos DB collection which is defined as unlimited with a throughput of 1000. It has the following document structure: 'Id': 'b42129d2-5467-450c-9f7e-744f78dfe1e7', // Primary key 'ArrayOfObjects': [ { // other properties omitted for brevity 'SubId': 'ed2a49fb-51d4-45b4-9690-df0...
Sylvoo
1

votes
2

answer
494

Views

Change Id type of asp.net core 2.2 IdentityUser

I'm new to dot-net core 2.x, so... I would like to change the type of the Id in asp.net core 2.2 IdentityUser from string to int. All the examples I've found via google (and the stackoverflow search facility) are giving me examples of asp.net core 2.0 which provides an ApplicationUser when you scaff...
Owen
1

votes
1

answer
458

Views

Configure log4net AdoNetAppender in asp.net core application

I am trying to configure log4net using MicroKnights AdoNetAppender(nuget 3rd party library) for my asp.net core application. However nothing is getting logged in database. Also I am not getting any errors when running the application. I suspect the connectionType is causing the trouble. log4net conf...
user2443401
1

votes
1

answer
454

Views

ASP.NET Core 2.1 Role Manager Register

In my seeding code I create Users and Roles, and the error seems to be whenever I run it through startup I seem to be getting 'No service for type Microsoft.AspNetCore.Identity.RoleManager'1[Microsoft.AspNetCore.Identity.IdentityRole] has been registered. EDIT*** I think the issue is that the code...
OCTAVIAN
0

votes
1

answer
12

Views

How to get hyperlink in a formula using EPPlus

I need to get the exact link inside the formula(HYPERLINK) and save it to the database. here is my code to get the link, answerList.Add(new SurveyCompetitorAnswer { MainSurveyId = id, Answer = workSheet.Cells[AnswerRowRange].Text, DateCreated = DateTime.Now, Link = workSheet.Cells[AnswerRowRange].F...
Chris May

View additional questions