Questions tagged [.net-4.0]
Version 4.0 of the .NET Framework. Use for questions specifically related to .NET Framework 4.0. For questions on .NET Framework generally, use the .net tag.
8,832
questions
0
votes
0
answers
24
views
Local Reports in Visual Studio 2022
I took over an application (WinForms) developed a few years ago that needs to run on older computers as well. In Visual Studio 2022, when I modify a report, the schema changes from 2010/01 to 2016/01. ...
0
votes
0
answers
12
views
Update Telerik.DataAccess.Core 2015.1.225.1 Assemblies to most recent nuget package
In our project we are using the the Telertik.DataAcess Assemblies shown here https://docs.telerik.com/data-access/developers-guide/deployment/visual-designer-deployment-consideration-operations-...
0
votes
1
answer
42
views
Ps command not running under windows service
When trying to run a ps command inside a windows service it returns me an error:
Get-LocalUser : 'Get-LocalUser' not recognized as cmdlet, function, script file or program. Verify if the file path is ...
0
votes
0
answers
11
views
NET Framework 4.0 breaks Com Interop - vb6 calling c# dll failing when changing target framework from 3.5 to 4.0 or higher
I have a C# custom control DLL that loads pdf in byte[] and render it in vb6 control which hosts my custom C# control.
This works without any issue when compiled against .NET framework 3.5 but stops ...
0
votes
0
answers
28
views
Why is IHttpHandler's ProcessRequest method not getting the original URL in the context in .NET Framework?
I have a class that implements IHttpHandler in a .NET Framework app,
and a ProcessRequest method that implements IHttpHandler.
public void ProcessRequest(HttpContext context)
{
//some logic
}
I ...
2
votes
0
answers
100
views
Sending email via Outlook365 from VB6/VB.net 4.0 application
We currently have a legacy VB6/VB.Net 4.0 application (we're stuck with those because of a need to support XP unfortunately), and one of its functions is to send out email. It currently works with ...
0
votes
1
answer
44
views
iTextSharp not protecting PDF with password
I am using iTextSharp 5 and trying to password protect already existing PDF file but it is not working. When I double click on new password protected file then Microsoft Edge simply opens without ...
0
votes
0
answers
79
views
System.IO.FileNotFoundException: Unable to load file or assembly Microsoft.SqlServer.Management.SqlParser
For some years we have been maintaining a customer's system that suddenly stopped working.
The system is developed in C#, framework 4, uses NHibernate as ORM, the design pattern is MVP, connects to a ...
0
votes
0
answers
69
views
Extract ECDSA non-exportable private key from x509 certificate
I have a x509 certificate stored in windows certificate store and it contains a ECDSA private key marked as non-exportable.
How can I retrive the private key for signing in C# with .Net framework 4.7....
0
votes
0
answers
375
views
how to uninstall .NET Framework 4.8 from windows 11
Problem
I've some commercial app to be runned on my system which couldn't work so their tech
team wants me to uninstall & reinstall .Net Framework. So, I did uninstall all .Net
related files ...
0
votes
0
answers
33
views
SGEN : error : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information
I have an ASP.NET Web API running on .NET 4.5. It is not a .NET Core application. I have integrated Swagger for my testing and version for swagger is 5.6.0.
And I am implementing Basic Authentication. ...
0
votes
1
answer
52
views
C#/.NET Constructor of WPF-Window is called twice when opened from Mainwindow
i have an application which starts with a Mainmenu integrated into the default MainWindow. That works perfectly fine, but now i have to create an automatic dataupdate function which should update the ...
-1
votes
1
answer
59
views
Best practice to handle async events and run huge post-processing code [closed]
Async event handler
I have this class to run an executable asynchronously:
namespace Feather
{
internal class Helper
{
private static Process cmd;
public static void RunLogic(...
0
votes
1
answer
136
views
Can't add empty folder to zip archive
I use C# .net 4.0. I create Zip archive using following:
internal void compressZip(string folderPath)
{
if (!Directory.Exists(folderPath))
{
MessageBox.Show("...
0
votes
1
answer
82
views
Using PrintDocument to print an image to the printer without margins
I'm trying to use a PrintDocument object to print an image to the printer but the image keeps coming out cut off a little on the right side.
private PrintDocument _printDocument;
public void ...
0
votes
0
answers
34
views
Difficulty in Modifying Cell Values in DataGridView
Hello Stack Overflow community,
I'm encountering an issue with modifying the values of cells in a DataGridView. The DataGridView is bound to a list, and I'm trying to add a new row to this ...
0
votes
3
answers
876
views
All .Net Framework 4 programs failes after recent security update (Net 5+ works)
I am battling with a problem, where all programs running by ".Net Framework" fails to start and I am getting (i.e.: Teams/Visual Studio):
xx.exe - This application could not be started.
...
0
votes
1
answer
131
views
How can I add key protection in web.config for .NET 4.5 framework
I want to add protection key in web.config file (for .NET framework 4.5) as we add api key in web api. How can I go about this?
Should I use following key type:
<machineKey validationKey="...&...
0
votes
0
answers
45
views
Error MSB6006: "lc.exe" exited with code -1073740771
I'm getting the following compile error very frequently on one of our project on .NET 4.0:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common....
0
votes
0
answers
14
views
DelphiPrism XE - strategies on migrating to .NET Framework 4.0 (4.8 really)
Maybe this isn't a strict programming question, but i'm working on an old project using DelphiPrism XE.
We have a large system in that Oxygene environment that cannot be simply rewritten.
Tools like ...
0
votes
0
answers
27
views
How Can I use Wrapper Pattern to add additional methods to sealed class?
I would like to ask you how can I get a method like GetAllActiveProjects(). I use Trimble.Connect.Desktop.Api. My class actually look like below:
{
public class TrimbleConnectWrapper : ...
0
votes
0
answers
25
views
Do I have to install the framework to use an application built with the same framework?...and several other questions
I want to ask a group of questions.
I want to develop an application CRM, what is the appropriate technology to build it using .NET, with a mention of the reason, although I have thought about using ...
0
votes
2
answers
320
views
Querying an HTTPS SOAP service fails in C#
first of all, i know near to nothing about SOAP (and i really hoped i'd be lucky enough to stay away from it), so pardon my total ignorance.
I need to call (from the .NET 4 Framework) some functions ...
1
vote
1
answer
33
views
Generic Volatile.Read to Thread.VolatileRead conversion
I need to get this code from .NET 4.5+ working on .NET 4.0. The generic Volatile.Read isn't available in that version. I'm trying to use the Thread.VolatileRead to get this working. I need to know if ...
0
votes
0
answers
18
views
After installion of crystal report it is not visible in toolbox as well as in .net components list
I have created a PoS system in visual studio 2015 using vb.net with .Net Framework 3.5.
Now i have to add reporting options into my application. I tried several time to install and use crystal report.
...
0
votes
0
answers
37
views
Task not creating concurrent files as stored procedure response is slow
I actually want to call my same stored procedure in concurrent tasks of C# and from that data it returns, I want to create CSV files, e.g I want to create files for all the days of a month from tasks.
...
0
votes
1
answer
90
views
Windows Forms Control.Invoke(Action) blocked while MessageBox is shown?
I have to debug code by a former colleague.
The application is part of a machine control. The machine is already delivered to our customer, which restricts my debugging abilities.
The situation is as ...
0
votes
0
answers
38
views
ASP.NET Framework - csproj and .sln not appearing in my project
There is an old project on .NET Framework 4.0 I'm to work on, and probably upgrade to 4.8.
I found out that it does not have a .csproj nor a .sln file, so I opened it as a website in Visual Studio ...
0
votes
0
answers
26
views
System.Timers.Timer stops by itself in a windows service
Hello I'm doing a check on a windows service that seems to stop doing its work after a undeterminate amount of time. The service keeps running but method OnElapsedTime stops getting executed, i know ...
0
votes
0
answers
233
views
How to downgrade to a lower version of .Net Framework
I have an application that targets .Net Framework 4.6.1, but in my computer I have installed 4.8.
In the production server they have 4.6.1 installed, and the exception System.IO.PathTooLongException ...
0
votes
1
answer
315
views
How to convert my existing Framework Soap Service
I have an existing SOAP asmx application developed with .NET Framework 4.0. The application was deployed then and it's still being used.
Now I have .NET Core 6 with Visual Studio 2022 installed on my ...
0
votes
0
answers
38
views
Combining Certificate + Key with .NET Framework 4.X
I want to import a key file to use the key with a X509Certificate.
I've imported a key via
System.Security.Cryptography.CngKey.Import(...)
to a [System.Security.Cryptography.CngKey] object. Using the ...
0
votes
0
answers
42
views
How to make copy of IWebProxy?
If I do:
var proxy1 = WebRequest.GetSystemWebProxy();
proxy1.Credentials = new NetworkCredential("admin", "pass123");
var proxy2 = WebRequest.GetSystemWebProxy();
proxy2....
0
votes
0
answers
39
views
Request from external party is not captured by the WCF service
I have a SOAP WCF service hosted in IIS and it is consumed by another company SAP system and everything was working fine for couple of years until our security team implemented Header validation in ...
0
votes
1
answer
43
views
connectionStrings from Multiple files App.config
I'm need to read connectionStrings from different files .config
file1.ddl.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration&...
1
vote
1
answer
88
views
Map two lists into a dictionary(of object, object) in VB.NET
given two lists of the same length, I need to zip the two of them together into a dictionary. I know this can be done using looping but didn't particularly want to go that route. I've seen a few other ...
0
votes
1
answer
31
views
Update claims for an loggedon User?
I have more higher level question for updating an onlogged user claims in an ASP.Net 4.8 website.
How should I do it?
If I recreates the claims on every post, then point of using claims seems ...
0
votes
2
answers
86
views
IGrouping Not Found in Razor View
I've done a GroupBy using Linq as follows in a controller:
model.aLstProducts = result[0].Results
.Where(c => c.Id == ProductId)
.ToList()
.FirstOrDefault()
.ListOfProducts
....
0
votes
0
answers
33
views
c# web api Facebook log out
I have a web api project in c# in which I do a facebook social login with oauth2 calling the urls of facebok
public ActionResult FacebookSignIn()
{
var loginUrl = "https://www....
1
vote
0
answers
17
views
From .NET 4.0 add reference to assembly in .NET 4.6
Visual Studio 2019 allows in the .NET 4.0 project Tests.Test_4_0.vbproj to add a reference to the .NET 4.6 assembly Tests.Test_4_6.dll. The editor allows to call methods of class Test1 in the .NET 4.6 ...
0
votes
1
answer
235
views
dnlib after ModuleDefMD.Write(file, options) Assembly attributes are deleted
Module Creation process
var file = Console.ReadLine();
var moduleContext = ModuleDef.CreateModuleContext();
var moduleCreationOptions = new ModuleCreationOptions(moduleContext, CLRRuntimeReaderKind....
0
votes
0
answers
27
views
System.EnterpriseServices client-side
I have the server-side .NET Framework 4.0 project Server1.vbproj that references System.EntrepriseServices, and some classes that inherit ServicedComponent. I compile and register the dll with regsvc ...
0
votes
1
answer
71
views
WCF connection status CLOSE_WAIT after client close connection
I have a big problem with connections to my server. I have a application which consuming data from clients, making many things with them and at the end returning confirmation. It is a WCF service when ...
1
vote
1
answer
456
views
How to implement google Authenticator In ASP.NET 4 webforms?
I want to implement two factor authentication using google authenticator in asp.net webform for .NET 4 framework .
Anyone knows the code please help me to solve this.
0
votes
0
answers
192
views
What is the easiest way to process JSON file in .NET v4.0?
As in title, I have to process JSON file using platform .NET 4.0.
I tried to use System.Text.Json and Newtonsoft.Json but
VSC complains about .NET framework versioning...
error MSB3644: The reference ...
0
votes
1
answer
414
views
Failed to load .NET framework 4.0 dll from .NET 6 project
I have a .NET 6 project and try to load a third-party dll, which build with .NET framework 4.0, dependencies are mscorelib, System.Configuration, System.Data, System.Drawing and System.Core, all are ...
1
vote
0
answers
34
views
How to prevent Windows stopping my vb.net (framework 4) when taking a very, very long time to process a function
I have an old vb.net Winform framework 4 application that I have to maintain.
This application is calling a function on a server which take about 20 minutes to complete.
The problem is that after ...
0
votes
0
answers
159
views
How to use Npgsql v 6.0.7 in a .net v 4.0 project?
Is there any way to use Npgsql v6.0.7 in a .net v4.0 project? And if there is, can you give instructions?
I need my .net v4.0 to work with PostgreSQL v14.5
0
votes
0
answers
75
views
Memory Leak making images disappear
First a little backgroud to the problem: We have an old Document Viewer that was created in WPF using NET 4.0 (we actually never updated, so still in 4.0) and a lot of developers actully worked on it, ...
0
votes
1
answer
372
views
Issue with creating symbolic link to directory in C#
I am trying to create a symbolic link from one folder to another in C# net472 without success. Here is my current code :
[DllImport("kernel32.dll")]
private static extern bool ...