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
0
votes
0answers
3 views

Why VSTO installer does not detect .NET higher Framework?

I have an Outlook plugin which is to be installed on company's multiple computers. THis is a Visual Studio project and I am using ClickOnce to install the plugin (.vsto file and DLLs). The problem is ...
0
votes
0answers
22 views

How to navigate from a page back to the MainWindow?

Im currently building a WPF application and im having trouble navigating back to the MainWindow from another page (compiledpage). I've able to navigate back to previous pages but not the MainWindow ...
-1
votes
0answers
13 views

Trigger Binding to Child Control Not Working

I have this on a WPF Window <local:TestControl> <local:TestHost /> </local:MediaPlayer> Classes defined like this public class TestControl : ContentControl { static ...
0
votes
0answers
11 views

Unity configured with PerRequestLifetimeManager() creating multiple instances of DbContext per request for WebApi requests, but not MVC requests

Here's my UnityConfig.cs: public class UnityConfig { private static Lazy<IUnityContainer> container = new Lazy<IUnityContainer>(() => { var container = new ...
0
votes
1answer
20 views

c#/.net core3.0 System.Text.Json - JsonSerializer.SerializeAsync?

I create test console app,(use net core3.0), and code as below: using System; using System.IO; using System.Text.Json; using System.Threading.Tasks; namespace TestConsoleApp1 { class Program ...
0
votes
1answer
24 views

How to use EF .SqlQuery expression in EFCore? [duplicate]

I'm refactoring a code and I have this question. public class MovimentoManualListRepository : RepositoryBase<MovimentoManualList>, IMovimentoManualListRepository { ConsultarContext _context;...
0
votes
0answers
10 views

.NET DocuSign API: Redirect User to docusign envelope to complete form

As part of a new docusign integration, I am trying to figure out how to redirect a user to docusign to fill out and sign/complete a document after creating it. Currently, I am successfuly ...
0
votes
3answers
46 views

C# - Check for null values in IEnumerable<T> of different types

How can I check for null values on IEnumerable<T> where T can be either a reference type or Nullable<T> type? I receive an object parameter in an method that can be IEnumerable<string&...
0
votes
0answers
7 views

problem with the setup of a .net project file

I'm trying to understand the fsproj/csproj files in .Net and I'm lost. I'm trying to invoke some precompiler phase with a tool (FsYacc) to generate some files used in the compiling phase. I'm at the ...
0
votes
0answers
11 views

AutoCAD C#/.Net: expose entities coordinates

My goal is to run my custom dll through AcCoreConsole and make various analysis on DWGs, such as expose Layer names and XY-coordinates on objects. I have managed to get all object in a selection set, ...
1
vote
1answer
14 views

Is it ok to use long-lived Tasks that aren't long-running Tasks?

Should I dedicate a Thread to a periodic cleanup task, or should I just use a looping Task that never finishes? Because the Thread would be sleeping most of the time, only occasionally waking up to a ...
0
votes
0answers
23 views

How do I connect to a Cassandra VM

The following code works if Cassandra and the code are on the same machine: using System; using Cassandra; namespace CassandraInsertTest { class Program { static void Main(string[] ...
-2
votes
0answers
24 views

Creating a Correlation ID in Windows Forms Application

facing some challenges, following are the scenarios In a custom logging application I have to generate and write log messages with correlation id for every, Set of function calls in a Windows Forms ...
0
votes
0answers
13 views

Web Page Authentication ASP.net current opinion

I am a novice (but learning) developer in C# and have several public websites. I now have one that needs to implement a user login. I have read the tutorials and blogs and watched several YouTube ...
0
votes
0answers
11 views

Running Puppeteer in Azure App Service Linux

I am running a .Net Core 2.x application in App Service Linux. When I run Puppeteer I got the following errors: /home/site/wwwroot/.local-chromium/Linux-686378/chrome-linux/chrome: error while ...
0
votes
0answers
17 views

Add hyperlink to smartart node with interop-excel in c#

I have an c# console application which create an excel worksheet containing a smartart object with the hiearchy layout(OrgChart). I would like to add hyperlinks to the nodes within the org chart, but ...
0
votes
0answers
14 views

How can I export an Excel worksheet to an image in .NET command line program?

I have an Exce file(xlsx file), and I want to use c# command line program to export the content of xlsx file to an image(jpg/png). I am using Visual Studio 2017. I added in the reference Microsoft....
0
votes
1answer
19 views

Retry SFTP if it fails?

I am using SSH.Net to upload but want to retry to SFTP the file if the process fails. I have this code but I don't think this is the best way to handle a retry. What would be the best way to go about ...
0
votes
0answers
13 views

Sqlite-net-pcl using Encryption is Not Working

I am using a nuget package sqlite-net-pcl in my .Net Standard Library application, however when i try to add a password(key) to my SQLiteConnectionString, it doesn't seem to work. Because i can access ...
1
vote
2answers
45 views

Propagate event to all controls

I'm using the following piece of code, for documentation, error handling and/or logging. It's saves an image of the UserControl or Form when I click it pressing Control+Alt+Shift: public Image ...
0
votes
1answer
14 views

Policy-based authorization vs authorize with role in .Net Core

What is the difference between using policy-based authorization and authorize with role, or there is no difference? [Authorize(Policy = "RequiredAdminRole")] and [Authorize(Roles = "Admin")]
0
votes
0answers
15 views

Is Multi Authentication on one Endpoint Considered Bad Practice?

Whilst this question is arguably opinion based, I am looking to gauge the opinions of other engineers on this matter in order to assist in settling a debate between two engineers. Consider the ...
0
votes
0answers
17 views

Do FileStream buffer support random writes without auto flush?

I have a FileStream of 10 MB and I'm writing random positions (about 2 kB in total) with a buffer of 4 kB. Will the stream only write to the buffer and only write to disk when flushing? Or does this ...
0
votes
0answers
8 views

Google People API: null when listing connections

When using Google.Apis.PeopleService.v1, the people.connections.list method seems to work (no exceptions are thrown) but the returned object always have all its fields set to null. Here is the ...
0
votes
0answers
15 views

FTP - create a folder in a folder [duplicate]

I can create a folder on a ftp. However when I create a folder within a folder I get an error (_config.FtpHost is set to ftp://xx.xx.com/): var ftpWebRequestCreateDir = (FtpWebRequest)FtpWebRequest....
0
votes
0answers
7 views

Asp .net Identity ApplicationUser is not accessible in Account Controller given referenced from class library

Hello all I have added a data layer in .net MVC project and moved identity model in data layer class library but application user from class library is not working in Account -> register and Account ->...
0
votes
0answers
13 views

Transparent status bar shows webview content while scrolling IOS

i have put a webview, Anroid is working fine but on IOS, when i scroll, i see the content scrolling behind the transparent status bar. Click and see the top left corner of the image i have tried ...
0
votes
0answers
13 views

How to convert ClippingPathInfo to image using iText7

Using below code I am trying to extract image from PDF. These images are having only text information in PDF. In the below code at event listener, event type is always two values. 1.CLIP_PATH_CHANGED ...
-1
votes
0answers
19 views

Update operation in xunit using moq

I am trying to update using xunit and moq repository but my code doesn't update the changes. I am not sure if the update code that I have written is correct or not. Could you please help me with the ...
0
votes
0answers
17 views

What is the Guid for clientSideExtension, editor for Software restriction policy?

This link says that to save a GPO (GroupPolicyObject.Save(Boolean, Boolean, Guid, Guid)) one needs to specify two GUIDs namely clientSideExtension, editor. Sadly I couldn't find clientsideextension ...
-3
votes
0answers
28 views

“Process cannot access the file” the file because it is being used by another process

I've been getting this error every time I try to run my project I don't know how to solve this problem
0
votes
0answers
7 views

X-API-Key and JWT authentication Token validations are not working together in .NET. X-API-Key validation is done is middleware

public class Startup { public IConfiguration Configuration { get; } /// <summary> /// /// </summary> /// <param name="configuration"></param> public ...
0
votes
0answers
21 views

Error Casting Generic Interface Implementations? [duplicate]

I have the following scenario 1 - Interfaces public interface IFileStorage<TConfiguration> where TConfiguration: IPluginConfiguration public interface IPluginConfiguration 2 - ...
0
votes
0answers
9 views

How do I send JMS traffic wrapped in web traffic (Http/Https) to a local IIS server?

I am able to successfully setting up my ActiveMQ with Java Spring using a http/https transportConnector, as opposed to the typical tcp or udp transport mediums. This makes my JMS traffic wrapped up in ...
1
vote
1answer
30 views

Why isn't NSubstitute.Return called?

I'm using NSubstitute in an integration test by wrapping a real implementation with a mock, like this: var realRepository = container.Get<IRepository>(); var proxyRepository = Substitute.For<...
0
votes
0answers
9 views

How to send “Hello World” for testing WebSocket function in EmbedIO

I want to test the function of WebSocket in EmbedIO. (Version 3.1.1) The following is my code (C#): using System; using System.IO; using System.Net.WebSockets; using System.Text; using System....
0
votes
1answer
11 views

Share a database with .NET Web Application and .NET Mobile App

Is it possible to share a database from a .net core web app and use it to build a phone app? I haven't been able to look at the phone development yet but I know I would want the same database. Where ...
0
votes
1answer
17 views

Email template under wwwroot is not found

I have some email Templates under the wwwroot folder which i use on my EmailService, it works on local, but when i launch the web app into the azure Vsts, i get the error System.IO....
0
votes
0answers
19 views

Uninstall 4.7 .dotnet framework and install 4.6.1 on windows server 2016 win10

We have a windows server 2016 win 10 machine that has dot net framework 4.7 installed. Now i have a need to install 4.6.1 for an application that uses Arcfm desktop and as per their doc their target ...
0
votes
0answers
28 views

Reading dates from an excel file in SSIS. SSIS reads dates in a different format

An excel file has all the dates formatted as MM/dd/yy, I read it in SSIS via c# script, but while looping through the records I notice that some dates are read as dd/MM/yy. Somehow either Excel or ...
0
votes
2answers
20 views

Set Table Attribute Dynamically [duplicate]

I am trying to set the TableAttribute for my view like so: [Table(LSODatabase.databaseString)] However the following error is thrown: An attribute argument must be a constant expression, typeof ...
0
votes
0answers
29 views

.NET Core 3.0 IHostedService access web server URL - scheme, host, port etc

The issue that I have is simple. I want to access the server URL in my IHostedService. I cannot find a way to do it. There isn't any request there so I cannot use the IHttpContextAccessor. IServer ...
1
vote
2answers
38 views

How to run python neural network keras script in c# .net core app

I need to run python neural network script in witch using imports: from keras.models import Sequential from keras.layers import Dense from keras.callbacks import History from keras.models ...
1
vote
0answers
63 views

Graphics.DrawImage on High DPI 150%+ Only Draws Portion of the Image

This issue happens on Windows 10 Creators Update or later using 175% zoom or higher targeted .Net 4.7.2. Further, we are calling SetProcessDPIAware in the Program.cs file. If we do not call this ...
0
votes
1answer
24 views

Making cURL GET call is C# and .Net

I've never used cURL in the past. I am pretty proficient with c# and .net as well as javascript/jquery but I am trying to use the below cURL call and turn it into an HttpClient request through c# and ...
0
votes
1answer
38 views

Nested Try-Catch: Throw an exception for outer try catch loop

I have defined 2 custom exceptions like Public Class SkipException Inherits System.ApplicationException End Class Public Class NoRecordFoundException Inherits System.ApplicationException End ...
2
votes
0answers
24 views

Windows application deployment with SQL Server database and Entity Framework error

I have a Windows app which I developed with Entity Framework and a code-first approach. It's working perfectly on my own computer. But when I try to deploy the app to a client who has SQL Server ...
0
votes
0answers
22 views

Keep a console app running in loop for windows service when there is a new row with a particular column value inserted

I am working to crete a console app to be run by a windows service, my goal is to check a particular column value in SQL, if it's zero (0) then my app would send a notification and marks it to one(1). ...
0
votes
0answers
20 views

How to remove home from URL in endpoint routing in .NET Core 3.0?

I have build a website in the new .NET Core 3.0 and I want to remove "home" from the URL to optimize for SEO and the end user experience. I was successfully doing this in MVC conventional routing, but ...
0
votes
0answers
9 views

Environment.ProcessorCount not showing correct number even when Thread_UseAllCpuGroups is enabled

I have a client running a system with dual Xeon Platinum 8160 hyperthreaded 24 core CPUs and Windows 10 Pro 64 bit. When he runs my app, Environment.ProcessorCount reports there are 32 logical ...