Top ".net" questions

Do NOT use for questions about .NET Core - use [.net-core] instead.

"An attempt was made to load a program with an incorrect format" even when the platforms are the same

I'm calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is: BadImageFormatException: An attempt was …

.net 64-bit pinvoke 32-bit badimageformatexception
Best way to read a large file into a byte array in C#?

I have a web server which will read large binary files (several megabytes) into byte arrays. The server could be …

c# .net bytearray binary-data
Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I developed a Windows service using C#.NET to generate PDF report. To generate PDF file I am using a …

.net windows-services com-interop 32bit-64bit
How to delete an element from an array in C#

Lets say I have this array, int[] numbers = {1, 3, 4, 9, 2}; How can I delete an element by "name"? , lets say number 4? Even …

c# .net arrays
Type or namespace name does not exist

I have a WCF Data Service project built with Visual Studio 2010, which was working fine. All of a sudden, it …

c# .net visual-studio-2010 visual-studio
What is the difference between int, Int16, Int32 and Int64?

What is the difference between int, System.Int16, System.Int32 and System.Int64 other than their sizes?

c# .net
Reading/writing an INI file

Is there any class in the .NET framework that can read/write standard .ini files: [Section] <keyname>=<…

c# .net ini
Initialize a byte array to a certain value, other than the default null?

I'm busy rewriting an old project that was done in C++, to C#. My task is to rewrite the program …

c# .net arrays initialization
Split a string by another string in C#

I've been using the Split() method to split strings, but this only appears to work if you are splitting a …

c# .net string split
Get current folder path

I want to create a program that converts files. I would like the user to be able to place the …

c# .net winforms path