Questions tagged [net#]

415270 questions
0

votes
2

answer
34

Views

How to update a global variable inside `where` clause in LINQ?

I want to filter a list using LINQ with Where extension method. But apart from filtering I also want to update a global variable inside Where. However I cannot do it. Consider this example: var list = new List { '1', '2', '3', '4', '5' }; bool flag = false; var newList = list.Where(item => { flag =...
1

votes
1

answer
29

Views

can't connect to method in the controller

I'm using asp.net web api. I'm trying to have a positive response from the server, however program is not seeing one of the methods in the controller. It goes into the controller constructor, but not further. The response is Status Code 404, Reason Phrase: Not Found. I understand that it can be a...
Alice
0

votes
1

answer
26

Views

How to call an implemented interface method with different return types? [duplicate]

This question already has an answer here: Does C# support return type covariance? 9 answers I've an interface that has one method with an Interface return type. Is there a way to implement that method in different classes with different return types (derived from the interface return type)? This is...
Phoenix_uy
2

votes
1

answer
110

Views

Trying to make epaper dynamic using C# asp.net web form

I have static e paper but i want to develop dynamic e-paper like below url https://epaper.dawn.com/?page=15_04_2019_001 I have no idea to start e paper dynamic below is my whole html code q Times body { background-color: #fafafa; min-height: 100vh;} .container { margin: 200px auto; max-width: 600px;...
mohd mazhar khan
0

votes
0

answer
6

Views

Secondary thread causes “Application has stopped working” crashes even when invoking

I have an application which has a form with a DataGridView bound to a BindingSource, which is bound to a DataTable: bsList.DataSource = dsData bsList.DataMember = 'List' dgvList.DataSource = bsList The underlying data which populates dsData.Tables('List') can change whilst the user is working so to...
WSC
-4

votes
0

answer
8

Views

how to prevent download file from websites [on hold]

I have try and searched lot of way to prevent the file download options from my web application .But i unable to do it .Anybody known , If is it possible please share the details to me.
somu
0

votes
0

answer
8

Views

StructureMap: how to report problems

Suppose I have an object that is itself declared as StructureMap registry but I forgot to add some dependencies to its list so the object cannot be built. For some reason, this does not manifest at all in any logs. How such debug information can be viewed?
Askar Ibragimov
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
2

answer
1.5k

Views

SessionID keeps changing in ASP.NET Core web api

I am using Angular 2 as front end and Asp.net Core Web API as server side.my problem is when i am trying to maintain session in HttpContext.Session ,But for every request the Session Id is Changing and the data has been lost,Know i want to Manage session in server side Is it possible to maintain ses...
Riyaz Ahamed
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
1

answer
869

Views

Breakpoint failed to bind error when debugging .NET framework code?

I'm trying to debug System.Security.Cryptography.Xml.SignedXml and related classes in Visual Studio 2015, but I consistently see lines in the core framework code being skipped while stepping through in the debugger. Unfortunately, the lines that are skipped include the lines I need to debug. Has any...
The Velcromancer
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
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
1.1k

Views

SingalR Error during negotiation request

I've got a project with SignalR and AspNet. I'm trying to connect my client (its a cors) and the first request returns 200 code but I'm getting this error in my client side: Error during negotiation request. My SignalR Server side classes: public class Startup1 { public void Configuration(IAppBuilde...
patricia
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
1

answer
13

Views

Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only support

I am going to receive an object like the following: BOI BOI SBH SBH BOI 2234682 bsnl 1116 SCIENTIST 'E' B Rama Krishna Reddy 51910 false A- N 01-07-1958 00:00:00 B Pulla Reddy(Late) M M and here is my interface export interface IEmployeePersonalInformation { EmployeeCode: string; EmployeeName: strin...
rammi
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
1

votes
0

answer
12

Views

Verifying database schema in a database-first application?

I'm currently working on a project that quite often fails due to enormous amounts of models and the wrong approach that was taken (database-first) in such app. While I can't remake the entire application using code-first approach, is there any way to verify database to find all missing relations, co...
JCode
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
15

Views

Migrate WSE to WCF

using Microsoft.Web.Services2; using Microsoft.Web.Services2.Security; using Microsoft.Web.Services2.Security.Tokens; using Microsoft.Web.Services2.Security.X509; public void ConfigureService(string username, string password, string certKey) { var service = new WebServicesClientProtocol(); service.U...
Medo
0

votes
0

answer
5

Views

How to copy the dependency file of a dll during the build operation?

We have created a library project for creating assigning report source for rdlcs. We also maintain rdlc files inside the library project. Now we are using this library project in multiple project by adding this project as reference. While doing the build of projects the library project becomes as...
Suresh B
0

votes
0

answer
6

Views

Microsoft WPF tutorial - Create the UI for ExpenseReportPage doesn't do what it's supposed to

I am learning WPF from (https://docs.microsoft.com/en-us/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application), but when i come to section (https://docs.microsoft.com/en-us/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application#create-the-ui-fo...
Janko
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
10

Views

How to Fix “ The model item passed into the dictionary is of type but this dictionary requires a model item of type ”

I want to make paging in the table using Pagedlist and get an error The model item passed into the dictionary is of type 'PagedList.PagedList1[System.Collections.Generic.KeyValuePair2[MyProject.Data.Models.User,System.Collections.Generic.IEnumerable`1[MyProject.Data.Models.Role]]]', but this dictio...
chaeusang chen
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
1

answer
84

Views

Odd behaviour onCanExecute RelayCommand MVVMLight 5+

I'm migrating a tool from MVVM Light 4.0.3 to 5.4.1 and I have found a very odd issue with the newest RelayCommand implementation. This is the old implementation in the V4.0.3: This is the newest implementation in the V5.4.1: Before I was able to use variables to define the canExecute behaviour (ena...
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
2

answer
523

Views

Azure CloudBlobStream serialization (with Json.NET)

I have a little problem. My environment is a console app in .NET Core 2.1. Look at the this code: private static void Main(string[] args) { try { Console.WriteLine($'Test starts: {DateTime.Now.ToString('o')}'); string connectionString = '[My connection string]'; string containerName = 'mycontainer';...
Attilio Gelosa
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
1

answer
1.8k

Views

How to streaming video via VLC api in C#

I'm working on small home project for video broadcasting. I've found some example. I've found some example Example, but it does not works, because needed old version of library 0.8.6. So I found it, but I have exceptions on unmanaged code when I've tried to get components from API. So maybe somebody...
JDo
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
3

answer
2.4k

Views

dotnet build - get error “could not return the default page '/index.html'”

try to generate my project into exe file, but get error: before: 'dotnet build -r win10-x86' is ok after run generated exe, all is ok also: indows DPAPI to encrypt keys at rest. Hosting environment: Production Content root path: C:....\currencyColution\correncyProject\bin\Debug\netcoreapp2.1\win10-x...
Max990
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

View additional questions