Questions tagged [.net]

The .NET framework is a software framework designed mainly for the Microsoft Windows operating system. It includes an implementation of the Base Class Library, Common Language Runtime (commonly referred to as CLR), Common Type System (commonly referred to as CTS) and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++/CLI. Do NOT use for questions about .NET Core.

-1
votes
0answers
14 views

Is it good practice to initialize ObservableCollection<T> simultaneously each time?

i have a method that returns items or IEnumerable<T>, i want to convert this IEnumerable<T> to ObservableCollection<T>. from searching on Stackoverflow and web. i find there's no ...
0
votes
0answers
5 views

Python SignalR Client Application - How to get the ConnectionId after connection to SignalR Hub

First time poster. This is my first experience developing a microservice using .NET. Clients will use a REST API to request the service, the API will use the microservice to get results and send back ...
-1
votes
0answers
24 views

Implementing web based customer care chat in C# [on hold]

Let me start by saying this is my class project. I am not looking for someone to do my homework but looking for guidance to do it proper way. I am starting a project to create customer service chat ...
0
votes
0answers
12 views

dotnet core applications have very slow internet access when running on local machine

When dotnet core applications are run from my local machine, they have extremely slow internet access. For example, if I create an application using dotnet new console, and add the following code: ...
0
votes
0answers
27 views

Unable to split the string properly

Code Logic I'm trying to read file_path and file_hash stored in a list of string. They both are seperated by " |+| " as delimeter. I want to read them into a temporary array "tempArray()" where ...
0
votes
0answers
20 views

SSMS extension exception

I want to build a simple SSMS extension for my needs. I created VSIX project and it works perfect within VS. But when I try to test within SSMS - it does nothing. I set up checkbox to copy content ...
1
vote
0answers
18 views

.NET dll calling in MATLAB

I have a public .dll (KRcc64.dll) created by a manufacturer using .NET for interfacing any code with his machine . It has a class called "Commu" for making TCP/IP connection with the machine . ...
0
votes
0answers
10 views

Is it possible to change height of KeyboardButton in Telegram.Bot

I use .NET Client for Telegram Bot API https://github.com/TelegramBots/Telegram.Bot to make buttons for Telegram Bot. But I can't change buttons' height. It`s very big. Maybe, it`s not implemented in ...
0
votes
0answers
8 views

Can't Access server resource, Authorization Header Sent?

I am not able to access protected resources on web api e.g. [Authorize] using OAuth/OWIN ... What I am able to do: 1. generate bearer token 2. send bearer token (from Axios) 3. I've tried this ...
0
votes
0answers
19 views

How to return List<dynamic> with Dapper.NET ORM that can bindable?

Please i wanna keep this question answer itself. don't bother by adding modifications Hello, Dapper ORM is very fast and light-weight database mapper. so people use it as a replace of slowly entity ...
1
vote
0answers
31 views

MS Access - missing operator in query expression

I'm developing a .Net Platform app running against an Access Database. The query is failing with the error: "Syntax error (missing operator) in query expression 'Repairs.CustomerId = Customer....
-1
votes
0answers
37 views

Issues with inheritance, do I need extra abstract class [on hold]

Suppose, I have the base abstract class Function that looks like this: public abstract class Function { public abstract string Invoke(string[] args); } And also I have a child sub-class ...
-1
votes
0answers
30 views

WPF Application doesn't show up on other machines

I made a WPF Application and I can run it without trouble. But when I send the Release Build to my Friend it just won't open up, but the Process runs in the background. I assume that the reason is, ...
-1
votes
0answers
11 views

Database connection form D drive on iis

I am currently building my project in core php. In that used the mysql for the data storage. Now i have to transfer my project form test environment to the production environment. But the ...
1
vote
2answers
21 views

How to do this?: DataTable.Select(“[Enabled].ToUpper ='TRUE'”)

Is there a way to include an embedded .NET function in a DataTable Filter? I assume not. Please see my embedded comments in the code pertaining to the ToUpper function that I want to include. Imports ...
0
votes
0answers
6 views

Does the command “aspnet_regiis.exe -pef connectionStrings path” use the machine key to encrypt the config section

Does the command below use the machine key to encrypt the specified part of the configuration file? aspnet_regiis.exe -pef "connectionStrings" C:\path\to\application It seems the command uses ...
0
votes
1answer
18 views

EF Core change isolation level programmatically?

I'm learning EF Core and trying to change the isolation level of a transaction instance. Here is the code I set up a transaction instance with ReadUncommitted level : var transaction = new ...
-1
votes
0answers
23 views

Which Windows Contacts can I access from my wpf application?

My app needs to be able to load names and addresses from ideally whatever contact list a user might prefer. So far it can load CSV files, Google (Gmail) contacts and now Outlook Contacts. Not being a ...
1
vote
1answer
29 views

An invalid request URI was provided. (No helpful info in the stack trace)

Pulling my hair out here. All was working fine, and then out of the blue, I started to get some errors around Microsoft.Owin.Security. Following some tips on this site, I un-installed that package and ...
0
votes
1answer
18 views

Display Text with HTML image tag inside WPF control

I try to display a Text that contains a string plus HTML tags, and render images. SourceText="TextToDisplay <img Source="Http://...cat.png"> and thats <b>it</b>"; RichTextBox ...
1
vote
3answers
62 views

In .NET, why is ObjectCache the preferred type over MemoryCache?

So many examples of using the memory cache in .NET (including the official docs) instantiate it with: private readonly ObjectCache memoryCache = MemoryCache.Default; Is there any reason to prefer ...
0
votes
0answers
10 views

How to display list of items and add new list in same view in MVC .net core

First I am new to Asp.net core MVC. I see that I can only have only one model in the view pages. I see ways like dynamic binding, partial but it does not work with my taghelpers. I just want 2 div's ...
0
votes
0answers
3 views

FacetFilters filter with OR option in .Net

I am trying to filter my data on basis of OR condition in .Net. its working very fine with one condition but if i provide multiple options it work like AND. Here is my code that is working as AND ...
1
vote
1answer
18 views

How to run .net core application with launch profile via docker

I am using Docker to deploy my ASP.NET Core app to a Linux machine. I have a pretty much default Dockerfile that looks like this: FROM microsoft/dotnet:sdk AS build-env WORKDIR /app # Copy csproj ...
0
votes
1answer
26 views

Namespace or type 'Twilio' could not be found

I'm trying to use the Twilio API in my unity project but when I try to build in unity I get the error: namespace or type 'Twilio' could not be found (are you missing using directive or reference?) Now ...
0
votes
0answers
10 views

Install a Windows Service having parameters

I try to install a Windows Service having parameters. I try to reproduce something like this: but it seem impossible to install it like this : InstallUtil.exe "C:\MyPath..\MyExe.ProcessorService....
0
votes
0answers
6 views

EPPLus [Nuget] dependencies

I'm working on importing EPPlus into one of my projects. Seeing that I don't have any intention on modifying the encapsulated source I'm thinking the best approach is to import the nuget package. I'm ...
4
votes
1answer
50 views

Are F#'s generic member constraints possible within C#?

F# allows constraining generic types on the type's members, similar to: type ClassWithMemberConstraint<'T when 'T : (static member StaticProperty : unit)> = class end This can be very ...
0
votes
0answers
29 views

Proper architecture in .net core N-tier

I am working on a personal project in MVC core 2.1, reading about N-tier layers I apply the follow pattern (I simplified the code): My DBContext: public class CRUDContext : DbContext, IDisposable { ...
1
vote
0answers
33 views

Multiple Contexts - Right Way To Use Identity Framework Context And Entity Framework DbContext

I'm learning Identity Framework wonder what is the right way to use it. I have two context - one for Identity Framework and one for my application data (Entity Framework) - call them IdentityContext ...
0
votes
0answers
24 views

Programmatically focus/highlight a ListView column header in WinForms VB.NET/C#

On a WinForms ListView, hovering over a column header causes it to focus or highlight. For example: I need to do this dynamically, as in my program using the left and right keys switches the focused ...
23
votes
6answers
3k views

Redundant comparison & “if” before assignment

Here is the example: if(value != ageValue) { ageValue = value; } I mean, if we assign the value of a variable to another one, why would we need to check if they have anyway the same value? That ...
0
votes
1answer
21 views

MemoryCache expiration value .NET

I'm trying to cache some values and my goal is to keep them until they get overwritten. So basically they should never expire. var memoryCache = MemoryCache.Default; if (!memoryCache.Contains("data")...
0
votes
1answer
29 views

c# console how to print percent or dimension file or dimension of downloading

c# how to print percent or dimension file or dimension of downloading in this method WebClient client = new WebClient(); Uri uri = new Uri(Console.ReadLine()); // Specify that ...
0
votes
0answers
8 views

How do I test if my DLL will run in Linux

I need to test if some of the DLLs that I use will run in .NET core or mono, basically to see if we can run it in Linux, i saw this thread talking about Mono but I don't know how to use it to test my ...
-1
votes
1answer
27 views

Add Ordinal Date

Im trying to add an ordinal date using a public function as per below Public Function AddOrdinal(ByVal num As Integer) As String Dim ordinaldate As String Select Case (num Mod 100) ...
0
votes
1answer
13 views

Some (not all) punctuation in a tweet causes API error 32 “Could not authenticate you”

I rejoiced when I finally got some ASP.NET code talking to Twitter's API, and it performed perfectly when testing, creating tweets of any length on my account, mentioning @usernames, and even tweeting ...
0
votes
0answers
11 views

kendoDropDownList() is not a function with requireJs

Hello I have this js file where I define the dependencies define(["jquery", "core", "dropdown", "bootstrap"], function ($, kendo, kendoDropDownList, bootstrap) { console.log(kendo); $("#testCont")...
0
votes
0answers
20 views

Not able to Open Downloaded PDF file in Chrome

this is my code to take PDF files.when i am trying to open my downloaded PDF file in chrome,i am getting a error dialog with a message "Failed to load PDF document." if (!string.IsNullOrEmpty(...
0
votes
2answers
38 views

how to select data from table if table names are in Combo box

I was working on VB.NET and am now switching to C#. I was using the following code to use table as variable from combo box to fill a DataGrid: Dim strTAB as a String dtTAB1 = New DataTable strTAB =...
0
votes
0answers
14 views

Progress bar for long running server calls in ASP.Net MVC with Angular

I just want to create a progress bar while long running server calls. I could not create a ajax post request to the controller while the controller is doing a long running job. I want to create an ...
0
votes
0answers
19 views

Create an Installer file in .Net which runs on all browsers

I have an application that is made in .Net which is a client side code deployed at the server. This code is responsible for providing the private key token from the PC and sign a file digitally. As ...
1
vote
1answer
27 views

I am trying to use the AdvancedColorInfo class, but can't work out how to instantiate it

private AdvancedColorInfo advancedColorInfo = new AdvancedColorInfo(); I have tried the above code, but get this error: “AdvancedColorInfo doesn't contain a constructor that takes 0 arguments.” ...
0
votes
2answers
32 views

UI changes not persisting in ASP.Net application

I have a table that's hidden by default. When clicking the search button, I'm using jQuery to remove the d-none class and show the table. <input type="submit" value="Search" class="btn btn-default"...
0
votes
0answers
10 views

Zoom Image with ChangeView() - Windows Universal App - UWP Win10 - XAML

I'm currently building a Windows Universal App in which I have a ScrollViewer that contains an Image. The goal is to zoom into the image when double tapping it. The zoom is supposed to be centered at ...
-2
votes
0answers
44 views

How to disable keyboard programatically in c#? [on hold]

I want to develop an application in which I want to take input from bio metric machine and disable the keyboard input completely, while the application is running.
0
votes
1answer
29 views

Entity Framework Store Object in Column

I currently follow a pattern where I store objects which are serialized and deserialized to a particular column. This pattern was fine before, however, now due to the frequency of transactions the ...
0
votes
0answers
7 views

Where to place DefferedScripts of kendo grid when using it with RequireJs

I tried to initialize Kendo grid with the helpers. I have it like this in an .cshtml file that is rendered in Layout. @(Html.Kendo().Grid<FeatureViewModel>() .Name("testGrid") ...
0
votes
0answers
20 views

WPF TreeView DataTemplate binding with non-nested class problem

I'm trying to set up a tree view for my situation based on thisexample, but the difference is my classes are not nested inside the UserControl class, but in a separate namespace - .DataModel. I can't ...
0
votes
0answers
16 views

Write T4 generated code to loose CS files

I am creating a tt file that transforms text into model classes, to practice. A CS file is generated that with all models, but I would like each model to be saved in its own cs file in a different ...

http://mssss.yulina-kosm.ru