Questions tagged [.net]

Do NOT use for questions about .NET Core - use [.net-core] instead. 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.

Filter by
Sorted by
Tagged with
1
vote
0answers
12 views

Visual Studio copying DLL's to build directory even if i'm not referencing them

I've made a class library. It has the following references. I've set the Copy to Local property of all references all dll's refered to false. So I'm expecting only ModuleB.dll in the build directory....
0
votes
5answers
58 views

List.Where( “string”.Contains()) returns NULL in a LINQ Query

My Product class: public class Product { public int Id { get; set; } public string NameEnglish { get; set; } public string NameItalian { get; set; } } My Language class: public class Language{ ...
0
votes
0answers
16 views

Incorrect signature with RSA and SHA256

I have the following string:ET8d1voUkzNcqud7M8W0WQcd3l2Ih1ZtiMxStPeubKg I want to apply SHA256 to it and obtain its hash. Then I want to sign that hash with RSA and a private key. This is the ...
0
votes
0answers
5 views

how can you convert KML to WKT in c#?

I can easily convert WKT to KML using the nettopologysuite, with something like: WKTReader wktR = new WKTReader(); GeoAPI.Geometries.IGeometry geom = wktR.Read(wktString); KMLWriter writer = new ...
0
votes
0answers
5 views

How to force .NET Core projects to check dependency in a common directory?

My projects uses mostly the same nuget-packages and I have several projects in the solution. I was "forced" to add the same packages in all in my solution to make it work, with the result that the ...
1
vote
2answers
12 views

How to specify StringFormat for all TextBlocks bound to float / double value

Is there a way to specify StringFormat for all TextBlocks bound to a float or double value? So for example cases like this one: <TextBlock Text="{Binding AFloatProperty}" /> where ...
-3
votes
0answers
17 views

Modern Enterprise app, which recommended, WCF or ASP Web API? [closed]

I am planning to develop an enterprise app where clients interfaces will not proceed the business logic or SQL queries, so I am planning to use either WCF or ASP.net Web API, but what factors I have ...
0
votes
0answers
18 views

Can I add a Git link types(Branch, commit etc.)to my TFS(AZURE) WorkItems from Visual Studio?

Integration problems between VS and TFS My Team and Me faced a very confusing problem. We have changed our Version Control System from TVSC to Git. But we're still using Tfs as Project Managment ...
1
vote
1answer
55 views

Time difference from anywhere in the world

On my website i want to ensure if the time gap is under 1 minute of DateTime st of the below function, an action can be taken otherwise it would be declined. Here's the code for that DateTime ...
-3
votes
0answers
32 views

C# Cancel HttpClient from loading page [closed]

I have an HttpClient that is getting content from a website.The main content of the website displays instantly, but the process of loading doesn't finishes until 10 seconds later. Is there any way to ...
0
votes
1answer
20 views

Connect to a Winforms app using javascript client app [closed]

I have a Winforms windows app that runs on a pc that acts as a server (it doesn't run on a real server). It must run on a pc, because it needs to control processes. I need to have the ability to ...
0
votes
0answers
34 views

How to use parallel.foreach to navigate existing ships and for each, output the number of victories in battles [closed]

Here is the base diagram: My task is something like this: using the Parallel class to count the number of successful battles for a ship. First we get a list of ships, and then in parallel we ...
0
votes
0answers
10 views

Add a Framework to a Project in .Net Core3 in VS 2019

I have created a project in VS 2019 using the "Class Library (.NET Core)" template. Now I need to add the "Microsoft.WindowsDesktop.App" framework to the Dependencies\Frameworks "folder". Anyone ...
1
vote
0answers
28 views

What is the correct way to create a menu in WPF?

So I am developing a WPF application with .NET Core 3.0 now that 3.1 is out, I see there is a breaking change with the Menu and MenuItem I am using: https://devblogs.microsoft.com/dotnet/announcing-...
0
votes
0answers
20 views

DataGridViewButtonColumn is the last column as column 0

This is the code to fill the DataGridView Table from MSSqlLocalDB Table in my .NET C# Desktop Application. sqlConnection.Open(); dt = new DataTable(); adapter = new SqlDataAdapter("SELECT * FROM ...
0
votes
1answer
37 views

Instantiating object with full name

quick theoric question. I have the following code: if (partnership != null && partnership.UseCustomNotifier) { //some behavior } else { Integration.Protocol.Client.Notifier ...
2
votes
3answers
117 views

How to get a random order on a array.orderby C#

I am trying to find the nearest integer to a set integer from an array but want to pick a random one if there is more than one. var nearestScore = scoreArray.OrderBy(x => Math.Abs((long)x - ...
0
votes
2answers
44 views

Is it possible to create a csv string that orders by given positions using linq?

I'm creating a value converter that receives (object value) as parameter. Those are numbers of the object DrawNumber. I want to convert these numbers into a string separated by commas but the numbers ...
0
votes
0answers
5 views

Set TLS 1.2 for only a specific Request

I'm working on a system that communicates with a lot of 3rd party systems. This is a .net 4.0 application One of these systems is only accepting TLS 1.2 and i'm communicating using System.Net....
0
votes
1answer
9 views

mailkit.net/mimekit.net Get original Message from Multipart/Signed Message

I have a Multipart/Signed message and can verify it. Now I need to access the original Message to be able to access the attachments. Is there a way to access the original Message after the ...
0
votes
0answers
7 views

Is CA1026: Default parameters should not be used obsolete?

Regard Port FxCop rule CA1026: DefaultParametersShouldNotBeUsed #626 is analyzer rule CA1026: Default parameters should not be used discontinued. I wonder if default params (constants) are no longer ...
0
votes
0answers
38 views

What's the distinction between the roles of the .NET framework and “Visual Basic” compiler?

It was my understanding that the .NET framework essentially provided all of the built-in functionality (classes, methods, etc.) that is available when programming a VB.NET application. After all, that'...
1
vote
1answer
22 views

Azure Key Vault - programmatic creation

How can an Azure KeyVault be created programmatically using C# in a .NET core app? I have seen examples of writing to and reading from the key vault after it is provisioned but not on creating the kv ...
0
votes
0answers
8 views

Detect if appointment is deleted with EWS

I'm writing a .NET COre 2.2 application which can create appointments in Outlook, and on special conditions, it can delete them. For this, I use the Microsoft.Exchange.WebServices 2.2.0 package, and I ...
-1
votes
0answers
15 views

Is there a way to block out a character in a fastColoredTextBox? [closed]

Ok, so I wanted to block out (not allow) a character. How would I do this with a fastColoredTextBox (type of textbox you can find here)?
0
votes
1answer
58 views

remove excess values from dictionary c#

I have the following program to detect duplicate values and print distinct values from an integer array. but the Dictionary value prints one extra line value 0 occurred 95 times <- How to remove ...
0
votes
3answers
45 views

merge 2 lists into a new list that contains both data from list 1 and list 2 - where the unique key is “VariantId”

I have two lists of data (they are using the same class "SaleNumber"). Each list contains a list of sale numbers. The first list is taken from the danish "DK" database and the other from the swedish ...
-2
votes
1answer
19 views

How do I convert images stored as base64 in a .resx into image files? [closed]

I'd like to replace one set of images in an embedded .resx with multiple embedded files. The images are serialised somehow to base64 strings and are stored with their .NET type as expected (mostly ...
0
votes
0answers
15 views

Is manipulating view objects from view models a standard in Prism projects?

I have very little experience with Prism and .NET (< 1 year). Yet, I am working on a project where those technologies are used extensively. Also, I am an experienced developer, but in other ...
2
votes
1answer
34 views

Delete an application setting entry

I am able to create new application settings at runtime using this code : SettingsProperty property = new SettingsProperty(sthing); property.DefaultValue = "Default"; property.IsReadOnly = false; ...
0
votes
1answer
23 views

How to Populate ListView from a different namespace in a client server centric

This program is a client server program using Asynchronous Socket. I have the server side working very fine, the client side where i am having problem is receiving the data sent from the server side ...
0
votes
0answers
23 views

Unable to resolve 'Microsoft.AspNetCore.SpaServices.Extensions (>= 3.1.0)' for '.NETCoreApp,Version=v3.1

I recently downloaded the new version of asp.net core sdk (3.1.100) and created a .net core app project. When I wanted to addAspNetCore.SpaServices.Extensions (3.1.0) to my project, I faced these ...
1
vote
1answer
17 views

HasPermission is false on parent but true on child

I have a parent/childs relationship and both use AuthorizationRule. The save is always done on the parent. For some users, they do not have access to modify the parent but do have access to modify the ...
2
votes
3answers
62 views

How to remove (via linq) duplicates from a List of objects

My main object, has a property which is a List of tags [SharedCosmosCollection("shared")] public class GlobalPageTemplate : ISharedCosmosEntity { /// <summary> /// ...
-1
votes
2answers
44 views

Visual Studio C++ project on another PC fails to build

Tested with the following setup: Home - VS2017 or VS2019 Classroom - VS2013 or VS2015. I do code at home, then copy to my flash drive, bring it to the classroom and open a project from their PCs. ...
0
votes
1answer
17 views

The RenderTransformOrigin does not work.UWP

I have a problem that I don't understand how to solve it. I have a UWP application. In the XAML there is a Grid that has RenderTransformOrigin. But what value I would give it doesn't matter when I ...
1
vote
1answer
34 views

How can a .NET background thread detect that the main application is closing?

I am writing a library (a .NET Framework DLL). This library can be used in various kinds of applications: WinForm applications, WPF applications, ASP.NET applications, Windows services, ... even ...
0
votes
2answers
36 views

Visual Studio ADO .NET can't connect to mysql database

I work on Windows Forms project in C# and I need to connect to mysql database (localhost:3306). I use Entity framework 6.4.0 and .NET Connector 8.0.18. When I go to Project -> Add New Item -> Data -> ...
0
votes
0answers
23 views

What is the difference between node.js event loop and Kestrel (.net) worker process behavior?

in node.js we have one event loop in single thread mode that responds to requests concurrently. in .net development and in Kestrel there is one worker process that do the same but what is the ...
-1
votes
1answer
36 views

Angular Html + Css = PDF , problem to generate a proper PDF

I'm developing a web application using .Net core 3.0 (Back-end) and Angular 8 (Front-end). The user completes a form and then I have to generate a PDF (with design & picture) with the data that he ...
1
vote
1answer
17 views

I'm getting an error in my .asp file, and I don't know how to solve this (I don't know ASP). The error what i'm getting is the following

ADODB.Field error '800a0bcd' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. /Index.asp, line 216 and line 216-- <%ip=0 ...
1
vote
1answer
27 views

How to specify a default path for a File Target when a given event-property is not present?

I have a File Target as follow: <target xsi:type="File" name="f" fileName="${basedir}/Logs/${event-properties:EmployeeID}.log" ... /> This file target logs the ...
0
votes
0answers
32 views

AutoMapper: Missing type map configuration or unsupported mapping, C#?

I have such classes: public abstract class BookingShoppingCart : SerializableEntity, IShoppingCart { protected BookingShoppingCart() { Accommodations = new ObservableCollection<...
1
vote
0answers
30 views

How to use Entity Framework retry strategy when hitting deadlocks on reading

I have configured a retry strategy with Entity Framework (.NET framework) which works OK most of the time. I've never seen it not working for updates/write. But I do occasionally get issues that do ...
-3
votes
0answers
24 views

Problema com paginas aspx na migração de de Site para Web Application [closed]

Gostaria de uma ajuda de vocs. Estou migrando um projeto "site" para Web "Application", e com esta migrao os arquivos do webform que eram 2 agora so trs e os objetos das pginas aspx, exemplo: "...
0
votes
1answer
47 views

How to build .NET Framework executable that includes dependencies

I'm new to .NET, and have the following issue: I've written a simple application that references a few NuGet packages. I'd like to create an executable for my project, that can be run on one of our ...
1
vote
0answers
24 views

If I add Middleware in Startup File. That time not get request in Model

This Middleware added in the startup file. app.UseMiddleware<RequestResponseLoggingMiddleware>(); Middleware is public class RequestResponseLoggingMiddleware { private readonly ...
0
votes
1answer
16 views

Is there a correct way to reference a sqlproj project from a csproj project using Directory.Build.Props?

I am implementing a new solution which is dependent on a number of "content only" NuGet packages. These include a number of assemblies and dacpacs which I need to reference. My intention was to have ...
0
votes
0answers
28 views

How to mock DbContext using EntityFrameworkCore in .NET Core application

This question is regarding how to mock DbContext using EntityFrameworkCore in .NET Core application. Below are my code changes: My repository class will communicate with sqlserver using DbContext and ...
0
votes
1answer
35 views

The type or namespace name 'TEntity' could not be found (are you missing a using directive or an assembly reference?) in .NET CORE And vs 2019

i face this error , when i create IRepository and create Repository inherit of IRepository i have error in it and i declaration IRepository<TEntity> where TEntity : class why this error ...