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
7 views

Why EFcore PropertyEntry 'IsModified' useless

I am trying to update an entity by efcore 2.1.1 I don't want update two cols : "CreatedAt","CreatedBy" so I write a virtual function , I set column 'CreatedAt' a value, and then I exec my function to ...
0
votes
1answer
22 views

Marshalling a C++ Encoded String to C#

I am trying to read in a structure that was written to a file by a C++ program (I don't have the source code). I have been trying to read this structure into C# and marshal it so far without success. ...
0
votes
0answers
4 views

How to install .net framework 4.6.1 runtime on Windows Server 2012 R2

I spun up a aws EC2 instance Windows Server 2012 R2. It comes pre-loaded with .Net 4.5. But I'm running code that requires 4.6.1. I tried both the online and offline installers. I'm an admin. I'm ...
0
votes
0answers
9 views

Network service does not work after reconnecting

There is a service for monitoring the network folder, it performs its functions correctly, but there is one nuance: if the network is disconnected, then after the connection is restored, the service ...
0
votes
0answers
6 views

Trying to run a Task in .net 4.0 (using SSIS)

I've got an SSIS package which contains a few scripts. One of them gets a token via a rest api. I wrote the below, which works fine in .net 4.5 - however, our server isn't that up to date and we've ...
0
votes
1answer
24 views

The constraint reference 'string' could not be resolved to a type. (netcoreapp3.0)

I have got an error. This is my Startup class. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); } public void Configure(IApplicationBuilder app) { app....
0
votes
0answers
15 views

ASP.NET DataList returns empty with LinkButton in modal popup

So I have a DataList that needs to display a dynamic list of items, with an option for users to remove an item from the list. I have this in a modal popup. Whenever I go to display the popup, the area ...
0
votes
0answers
10 views

dll targeting 'AMD64' is not compatible with the project's target platform 'x86' when there is no x86

I am attempting to create an installer using Microsoft Visual Studio 2019. I have an old project that builds. It is set to build x64 and I have even deleted the x86 options. I added a Microsoft ...
1
vote
1answer
32 views

What exactly does a 'service … start' instruction mean for a .NET Core application?

I need to deploy a .NET Core app (that uses an MVC pattern) that's already been configured to run on an Ubuntu VM that's running under Azure. NGINX appears to be in use as a reverse proxy server. I ...
0
votes
1answer
12 views

Azure keyvault from on prem .net app without exposing clientid/clientsecret?

I've registered my app in azure AD and created a client secret and then created a vault and added a secret for the dbconnectionstring below. It works ok but I need the "client-id" and "client-secret" ...
1
vote
1answer
25 views

Passing data between 1 basic class and 2 WPF form

First of all, I'm new to C# and .NET development. I was working on a console app and decided to switch to graphical using WPF. Everything was fine with the console app but i'm having troubles right ...
0
votes
0answers
32 views

Real-time refreshing page (good practices) [closed]

I have 3 application WebClient (asp.core mvc) REST Api (asp.core) MobileApp My MobileApp and WebClient are interacting with Api, so after some operation in mobile and page refresh in webclient we may ...
0
votes
1answer
26 views

415 UnsupportedMediaType when trying to intercept a POST request

My feed provider send me a .gz file (zip file) by POST request to my server. I'm trying to implement the .NET code which will intercept POST request and unzip the file to open the file inside. I'm ...
0
votes
0answers
37 views

'IServiceCollection' does not contain a definition for 'AddControllers'

I have a ASP.NET Core 3.0 project running fine with the following startup: public void ConfigureServices(IServiceCollection services) { services.AddCors(); services.AddControllers(...
0
votes
0answers
7 views

IIS - Is it possible to avoid logging of default svc “This is a service” page?

When accessing a .svc-service on our IIS-servers it always produces an event in the messagelog. Is it possible to somehow manage to configure the site/app/IIS to not log these events? It logs the ...
0
votes
0answers
16 views

With .Net Core 3.1 and Visual Studio 2019 16.4.0 Is there still anything .NET Core still can't do but Framework 4.8 can?

Well, is it finally a non-frustrating experience to develop a desktop app in .NET Core? Has everything in the Framework (from a code perspective) finally been implemented (or at least have a ...
0
votes
0answers
21 views

ModelState dont see any keys in .net Core

i`m trying to make validation in .net core api 3.0 // POST: api/Users [HttpPost] public async Task<ActionResult<User>> PostUser(UserDto user) { ...
1
vote
0answers
53 views

SQL HashBytes vs .Net HashAlgorithm

I am working on integrating a new Authentication rest API that our web dev team wrote. The last piece I need to get working will return a User's User_Id GUID when given a username and password hash ...
0
votes
0answers
7 views

RabbitMQ notification on queue removal

We tried to get a notification when a queue is removed on RabbitMQ in dotnet. The "enable rabbitmq_event_exchange" command of RabbitMQ seems to enable that. https://www.rabbitmq.com/event-exchange....
-4
votes
0answers
37 views

How to fix the make like and dislike using two different methods for.e,g Stackoverflow vote [closed]

Im trying to create a code which uses a concept of C# and im expecting the result to be like if any vote method is call display function else break. Please find the code below using System; using ...
0
votes
0answers
20 views

Using WebBrowser to fill out a form - Element without ID

I am trying to use this line of code: WebBrowser1.Document.GetElementById("MainContentPH$TxtNameofRegister").SetAttribute("value", txtRegister.Text.Trim) For this element which is a textbox on ...
0
votes
2answers
36 views

MOQ Unit testing error. Expected invocation on the mock once, but was 0 times

I know this question has been asked on here before, but I am very confused as to why this test is failing. Here is the test I am running: public void ...
0
votes
1answer
22 views

dotnet build xamarin project fails using console

when i try to build my .csproj file with dotnet it throws to me an error, but when i build project at visual sutido 2019 its ok. I need to build with dotnet because azurepiple job use it. error ...
-2
votes
0answers
30 views

VB NET Custom DataGridView

I have a DataGridView with i fill from a list of two objects. This is the class where i put my two object into the list Public Class Casados Dim casado1 As Gallo Dim casado2 As Gallo ...
0
votes
0answers
9 views

Loading Web Services in Visual Studio No Object Browser and no endpoint auto created

I am attempting to load web services into Visual Studio. I am new to doing this. I have two WSDL for two different web services. From looking over the XML of the WSDL they are different in their ...
0
votes
1answer
32 views

Edit .prn file for printing it in C#

I downloaded ZebraDesigner 3 to create a custom label with a text field where I wrote "Hello World". Then I wanted to get its source code by "print to file", but when I open it with any editor I can'...
2
votes
0answers
32 views

Asp.net core 3.1 can't find Razor component to render

Im trying to integrate Blazor into an existing asp.net core 3.1 application. All tutorials I have seen, says that after doing the correct setup in the web project, you should be able to do this in any ...
-1
votes
0answers
17 views

Send PDF file to Network printer from server side C# code for automatic printing [closed]

I have a PDF file on a server with a IIS hosted WEBAPI application, once a specific API is called the PDF file should be send to a network printer and should automatically print.
1
vote
0answers
9 views

UseStatusCodePages vs UseStatusCodeWithReExecute issues

I have successfully set up Middleware to UseStatusCodePagesWithReExecute(). The application leverages against Active Directory to Authenticate and Authorize. Using Dotnet Core 3.0; MVC ...
-4
votes
0answers
18 views

LazyLoading are you missing an assembly reference [closed]

((Castle.Proxies.ProductsProxy)(new System.Collections.Generic.ICollectionDebugView(productSs).Items[0])).ProductCategories = error CS0234: The type or namespace name 'ProductsProxy' does not ...
0
votes
0answers
18 views

Is there a way to read the values provided in a DLL.config file and auto-cast them into their respective type?

The problem: Our application provides an extension system, which we make very excessive use of. The extensions are provided as DLL files, which bring their own .config file, respectively. Those were ...
0
votes
0answers
14 views

MSBuild fails with NugetPackage manager missing

I am trying to build a C# project with MSbuild (also dotnet). The project builds successfully on Visual Studio on another machine. I have the Nuget Packages in the path the sln file is looking for ...
0
votes
0answers
23 views

Docker how to deploy dotnet nginx ? (without .csproj)

Hello I want to deploy in docker: .net, kestrel and nginx. I have a project assembly without .csproj (it is possible or need .csproj ?) But when I try to deploy my .net project in Docker I had status ...
0
votes
0answers
21 views

Push to a POST API using Pub/Sub

I'm setting up Pub/Sub for my Android Management API solution, I have created a Topic & Subscription to create a ENROLLMENT notification. The subscription is of type PULL so when I pull it works ...
0
votes
0answers
36 views

Does it make sense to develop with web forms? [closed]

I start with a new project in my company... I developed with .net core and it is very powerful but I think it is slower for development, especially for the creation of the user inteface I think to ...
0
votes
0answers
30 views

how to change the background of bot framework v4 in c# [closed]

Currently my bot is made by using bot framework v4, It is transparent in color. I want to change the background of bot framework .How can I do it. Can any one help?
0
votes
1answer
16 views

Blank pages getting added, while merging multiple TIFF images into a single PDF

I am trying to merge multiple TIFF (multi-page) images into a single PDF having the same number of pages as the tiffs combined. Using PDFsharp library, I am merging 2 TIFF images each having 100 ...
0
votes
0answers
50 views

Updating PATH environment variable via registry setting using C# causes path to no longer be valid

I have a folder that I want to add to the PATH variable under Environment Variables (for the machine). I am appending the folder to the path via the registry setting. SYSTEM\CurrentControlSet\Control\...
0
votes
1answer
38 views

How to call Post method with multiple parameter from C# project

I Have created a web api project , in values controller i created a method InsertHeading which takes three parameters and returns back a unique id. The method looks like this :- public int ...
0
votes
1answer
54 views

Json Serializer for .netcore ant .Net3.5

Is there any json serializer library that work in .netcore and .Net3.5? I need to use a library in a multiplatform project the problem is that Newtonsoft's library works only in .Net Framework and ...
1
vote
1answer
14 views

'Dotnet failed to pack' error when trying to publish a powershell module to local repository

I'm working on MacOS 10.15, and I have a clone of the PSRabbitMq powershell module. I'm trying to publish it into a local repository I created: Register-PSRepository -Name TestPSRepo -SourceLocation '...
0
votes
0answers
21 views

How to set Encoding.Default for .NET app?

I have a problem with running the app in two different environments: local and inside docker container. The problem is the fact, that Encoding.Default is used in the app. Encoding.Default on the local ...
-1
votes
0answers
41 views

Windows.UI missing

I have a problem with a .NET application that I wrote some months ago, this application use these libraries: using Windows.Data.Xml.Dom; using Windows.UI.Notifications; When I've deployed the app ...
0
votes
0answers
21 views

Can't open uwp app with Launcher.LaunchUriForResultsAsync from wpf app (System.InvalidOperationException)

I have wpf app from which I would like to open uwp app and get some data from it. It is working fine when using LaunchUriAsync private async void Button_Click(object sender, RoutedEventArgs e) { ...
1
vote
4answers
69 views

How to ignore invalid enum values during xml deserialization?

I want to deserialize an xml document to a class, which is genereated by the concerning xsd files. I don't have control over the contents of the xml-file. During deserialization I run into an ...
1
vote
0answers
24 views

Entity Framework Does not work with foreign key interface

I sign my entire database model with Ientity interface, public List<TEntity> GetAll(Expression<Func<TEntity, bool>> filter = null) { using (TContext context = new ...
2
votes
1answer
26 views

Visualizing dependency tree depth in autofac

I may have been searching for the wrong stuff, looking in the wrong boxes. But I can't seem to find a good way to visualize how deep my dependecy tree is in C#. I've initially tried just hooking up ...
0
votes
0answers
16 views

.NET CORE getting universal password from Novell eDirectory in plain text in C#

The question title is self explanatory. In Novell eDirectory there is a supported way of getting universal password in plain text programmatically. We tested this with C language and it works, but due ...
0
votes
0answers
43 views

Line Number is not included in Exception Stacktrace (Code Dynamically Compiled with Roslyn)

I use the roslyn compiler to compile code on demand. Now when there is an Exception in the compiled code (example: Divided by Zero Exception) I get in Visual Studio the line number displayed: But ...
1
vote
1answer
28 views

Unable to upload JSON file to Azure Cosmos DB due to large file size

I tried to upload a JSON file containing a list of around 5000 JSONs to Azure Cosmos dB with Azure Migration Tool and was able to do that. It uploaded all 5000 items. However when I'm trying to do ...