Questions tagged [.net-4.6.1]
.Net 4.6.1 of the Microsoft .Net framework. .Net 4.6.1 is compatible with .NET Standard 1.4
272
questions
0
votes
0
answers
21
views
SSO with IdentityServer and a legacy ASP.NET Framework 4.6.1 app
We have a .NET Framework 4.6.1 app (not MVC) and want to integrate IdentityServer as an IdP to facilitate SSO with other sites. Say our app is our-app.com and we want to have our users automatically ...
0
votes
0
answers
72
views
Visual Studio for Mac to run .Net Framework 4.6.1 using Mono - Unable to select Mono version
I have been trying to run a project with target .Net framework 4.6.1 on Visual Studio for Mac 2019. Project is building successfully but giving runtime error
Could not load file or assembly 'System....
0
votes
0
answers
47
views
MSB3103 Invalid Resx file. Could not load file or assembly
I'm trying to build a project and receive following error:
Error MSB3103 Invalid Resx file. Could not load file or assembly 'file:///C:\Users\User.nuget\packages\system.buffers\4.5.1\ref\net45\...
1
vote
1
answer
89
views
Why can I write local functions in .NET Framework 4.6.1.?
Local functions were introduced in C# 7.0 and C# 7.0 came in .NET Framework version 4.7.
I'm absolutely certain that I'm running .NET Framework 4.6.1., but I can write and use local function without ...
0
votes
0
answers
56
views
Including a Month Calendar in a Windows Form always causes a System.ArgumentException. How to fix?
I am using Visual Studio 2019 with .NET Framework 4.6.1.
If I do the following:
Make a new project using the 'Windows Form App (.NET Framework)' template.
Select the .NET Framework 4.6.1. Later ...
0
votes
2
answers
99
views
How to escape triple quotes in C# string for the use GraphQL queries?
I am trying to run a Shopify bulkOperationRunQuery using GraphQL.Client.
The Query field needs to be set to the the below, but I am unable to set the Query field (type string) to include the triple ...
1
vote
1
answer
93
views
How to make JSON output key with Pascal Case for a single action method?
I am trying to make JSON output returned from a single controller action (don't want to set it global) as like this (PascalCase) :
{
"AuthenticationResult": {
"AccessToken&...
0
votes
1
answer
55
views
404 Resource not found on all views
I have an old project that I have never worked with and need to get running which is using .NET Framework 4.6.
Had warnings about misssing references (Antrl3.Runtime, EntityFramework. ExcelDataReader ...
0
votes
0
answers
171
views
Issue with building .NET Framework 4.6.1 project
I have bamboo build server. And I try to build there our old project with Target Framework .Net Framework 4.6.1
First step was completed successfully.
nuget restore .\Host.csproj
But I got error on ...
0
votes
1
answer
242
views
How to call Oracle stored procedure from C# which returns custom Object Type as OUT parameter
I have an Oracle 19 stored procedure which has 2 input parameters and 2 OUT parameters. One of the OUT parameter returns a table. Here is the code I have from C# but doesn't work and throws an error &...
0
votes
1
answer
168
views
Azure Open Telemetry - Activity is null few min after app start
I have a windows service that is processing Azure service bus messages. When I deploy this code to QA server, the first few messages received, telemetry works great. I see all the information ...
1
vote
1
answer
347
views
Calling a rest API using Tasks in loop and achieve good performance
I have a file with around 8000 employee records that I need to process by calling an rest API for each record. The sequential API calls are taking a lot of time, so I want to call them asynchronously ...
0
votes
0
answers
50
views
How to iterate Select and add index without AsEnumerable/Select((q, index))
I take a list of records from DB, which I need to paginate later, but filter before. Somethings like this:
... // I'm inside another .Select()
PaymentsReceived = p.ActivityPayments.Select(q => ...
0
votes
0
answers
182
views
how to install a ClickOnce application from a server that isn't known at publish time
I have a ClickOnce application that I want to install from whatever web server/domain it's installed on. There will be more than one, and I won't know in advance what they are.
Usually ClickOnce ...
3
votes
1
answer
466
views
Getting Hangfire to work in a Windows Service using .NET 4.6.1
For a project I'm converting an existing console to a Windows Service. The current console application runs a series of jobs consecutively.
The idea of the service is to run each of these jobs on a ...
0
votes
0
answers
423
views
Not able to connect to Redis from .NET 4.6.1 on SSL. From same windows server with java code(jedis) we are able to connect
Not able to connect to Redis from .NET 4.6.1 on SSL. From same windows server with java code(jedis jar) we are able to connect.
Error which I got:
It was not possible to connect to the redis server(s)....
0
votes
0
answers
148
views
Issue with (cairo and Sakkal Majalla) Arabic fonts with Aspose
Please advice I am facing same issue with (cairo and Sakkal Majalla) fonts.
when converting word document to pdf using Aspose.
even though I am used the fix you posted at last reply
any help please?
**...
1
vote
1
answer
67
views
Why is the derived class' virtual override only called when it's not written as an iterator method?
I'm adding unit tests for a class that uses Entity Framework. I've added test doubles based on this, and got a few tests running successfully. However, I reached a stumbling block when I began ...
0
votes
1
answer
81
views
Errors in .NET build context which shouldn't be errors- partial migration from 4.6.1 to 6.0
We're working on porting a product which runs on .NET Framework 4.6.1 to .NET 6. The catch is that it still needs to run Framework for legacy reasons, so we're multi-targeting frameworks. There are ...
0
votes
0
answers
68
views
WCF WebHTTP Binding throws 415 response
I have a WCF web application, that does not work post-deployment and when I send request via postman it gives me an error "415 Cannot process the message because the content type 'application/xml'...
-3
votes
2
answers
157
views
How to manage threads in multithreaded application that opens 160 windows in four monitors
I have a Windows Forms application which uses around 200 threads and 160 of them are Forms threads.
I am gathering data into application with TCP connection, I enqueue the messages into many ...
0
votes
1
answer
642
views
Add an image at the top of the pdf with 0 margin, however the rest of the body has left and right margin/padding (Itext7, C#)
I want to to create a pdf that contains a Bulletin logo/image with 0 margin at the top of the 1st page. However I want whitespace/margin for the content in the body, that looks like this:
I am using ...
0
votes
2
answers
101
views
Limit drag in single direction and to a specific location
I am trying to make a custom notification control for winform. I'm currently trying to make it draggable to a specific direction (say right). Also I don't want the notification to go beyond the ...
4
votes
1
answer
718
views
How to filter IQueryable for null navigation property
Say I have 2 simple models (below), where 'User' contains a navigation property to 'UserDetail' (one-to-one relationship):
Database
CREATE TABLE [dbo].[UserDetail]
(
[UserId] [int] NOT NULL ...
0
votes
1
answer
331
views
C# DataTable Min Value excluding NaN
I am having a problem with datatable in C#. I want to find the min value for a column in a datatable that has NaN value. For example:
c1 c2 c3
1 2 3
4 NaN NaN
NaN 7 9
Say if I want to find ...
1
vote
0
answers
325
views
Azure App Service Memory Working Set steady at 0 bytes
We have an S3 app service running in Azure and deploy updates every other Wednesday night.
After last night's update (no change in any framework or nuget packages) our Memory working set, for the ...
0
votes
1
answer
173
views
Why calling AWS APIGateway from .Net framework 4.6.1 gives internal server error unlike .net 6.0 gives OK status?
Why calling AWS APIGateway from .Net framework 4.6.1 gives internal server error unlike .net 6.0 gives OK status.
The same exact code using httpclient & same timeout 30 seconds.
0
votes
1
answer
670
views
My async task is blocking other code from running and not outputting anything
Recently I've been converting my node.js bot to C# but I've ran across an problem for some odd reason public async Task InitCloudCompute() is blocking my other code from running. I got no idea why ...
0
votes
0
answers
175
views
Service Soap Client WebService not authorized .NET/C#
I'm trying to call a method for a web service we use. I keep getting this error
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from ...
0
votes
0
answers
32
views
Why does an extra await cause synchronous execution? [duplicate]
I am trying to understand a comment made on a legacy piece of code...
The original code:
public async Task Send(Notification notification)
{
await Task.WhenAll(notification.Methods....
6
votes
1
answer
4k
views
Visual Studio Intellisense shows "new expression can be simplified", but that fails the build
I have this code
MyClass instance = new MyClass();
VS Intellisense shows:
'new' expression can be simplified
and upon selecting that action, it changes the code to:
MyClass instance = new();
but ...
5
votes
1
answer
10k
views
How to handle "A potentially dangerous Request.Form value was detected from the client"?
I've received some "generic" errors within the protected void Application_Error() handler on an ASP.NET MVC Framework application. The exception message is:
A potentially dangerous Request....
1
vote
1
answer
836
views
Cannot upload file to azure file share
I am trying to upload .msg file to azure file share. I followed the Azure Storage File Shares client library for .NET
My code
var connection = "DefaultEndpointsProtocol=https;AccountName=xxxx;...
1
vote
2
answers
166
views
isn't SaveChanges() managed by transactions?
I've several "thread" (i.e. Hangfire task) that will run in parallel this kind of function (each call passing different systemId):
private void UpdatePartners(int systemId)
{
try
{
...
1
vote
1
answer
695
views
AutoMapper from DataTable to DTO
I have a DataSet populated during an ADO.NET call which I want to then use AutoMapper to convert to a DTO.
I have defined a generic-use mapper for many of our DTO types:
IMapper DataReaderMapper = new ...
1
vote
0
answers
988
views
Headless unit testing for WebView2
I'm writing unit tests for a class that wraps the WebView2 browser control (WPF version if it matters).
Is there a way to run WebView2 in the equivalent of a headless mode so I don't have to actually ...
0
votes
1
answer
39
views
Why this routing is not catched?
I'm trying to catch "all route" which doesnt have a defined map and redirect to a custom page.
This way:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute(&...
0
votes
1
answer
137
views
Insights InstrumentationKey not populated after assignment in global.asax.cs
I have a .NET Framework 4.6.1 Web API solution which uses these Nuget packages:
<package id="Microsoft.ApplicationInsights" version="2.9.1" targetFramework="net461" /...
0
votes
2
answers
1k
views
How to log every web api request in Insights with .NET 4.6.1
I have a .NET Framework 4.6.1 solution which has this global.asax.cs:
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{ Microsoft....
0
votes
3
answers
381
views
Is there a way to discriminate a specific System.Web.HttpException?
I've some "bad boys" users which call my website using controller that doesn't exist.
Such as www.myapp.com/.svn/, or www.myapp.com/wp-admin/.
The app basically throw a System.Web....
0
votes
0
answers
33
views
Why do generic parameters need to be cast to object before cast to specific type? [duplicate]
Why is the intermediate cast to object necessary?
I'm wondering why the compiler team designed it this way.
namespace ConsoleApp4
{
class Program
{
static void Main(string[] args)
...
0
votes
1
answer
421
views
Is there any standard way to load array from appSettings.config file in .NET 4.6.1
I have a setting like this in my appSettings.config file
<add key="logFilesLocations" value="[firstfile,secondfile]"/>
Is there any standard way to read these values as ...
0
votes
1
answer
484
views
PowerPoint Interop: copy-pasting a shape crashes if done too fast
I'm using the Microsoft.Office.Interop.PowerPoint in a C#/.NET program in order to automate some operation on a PPTX file.
I'm trying to create a copy of an existing Shape in the presentation by using ...
0
votes
0
answers
162
views
C# Split string on 'þ', not on 'th'
In C# I have a string that I need to split on the character 'þ'. The problem is that the string is split on 'th' as well.
string dataline = 'is thisþis that';
string[] dataFields;
dataFields = ...
0
votes
0
answers
86
views
EF6 doesn't update table when it claims it has
Problem
Entity Framework reads from the database and then falsely logs that it has written back to the database. I first tried using synchronous code and then async code. Any ideas, please?
...
1
vote
1
answer
2k
views
.Net Framework 4.6.1 WebApi, Attribute routing and default routing not working
I appreciate any help on this. I'm currently working on a project where we basically have to convert an older .Net Framework MVC application into an API being utilized by a React front end. We were ...
0
votes
0
answers
345
views
Adding TLS 1.2 support in .Net applications
We have 2 tracks
Adding TLS 1.2 support to .Net 4.6.1 application
As of now we have added below line of code wherever we're making REST API calls
ServicePointManager.SecurityProtocol = ...
0
votes
1
answer
161
views
Unsupported subtype for CID font /CIDFontType0C
I'm using PdfPig to read text from a pdf:
using (var document = PdfDocument.Open(filePath))
{
var page = document.GetPage(0);
}
I'm getting an exception on document.GetPage(0);:
System....
0
votes
1
answer
701
views
Forcefully terminate thread generated by Parallel.ForEach
When using Parallel.ForEach(), is there a way to forcefully execute Thread.Abort on a specific thread?
I know that Thread.Abort() is not recommended.
I'm running a Parallel.ForEach() on a collection ...
1
vote
1
answer
734
views
How can I get current value of a Windows environment variable from a different session
Using C# with .Net 4+ or Standard 2.0 or Windows API, I would like to get the value of an environment variable for all users that are logged in, let's call the variable "Identifier". The ...