.net

How to check for versions of .NET from registry?

I want to check if .Net 2.0 or greater is installed on the machine. I want to check in a way that when newer versions are released the old code works. Registry check is ideal as the code is in C++. ...

Fail-Safe connection to domain controller with System.DirectoryServices

When using a DirectoryEntry to initialize a DirectorySearcher object, I've been just using the simple LDAP string of "LDAP://dc=mydomain,dc=com". The problem with this method is that on Windows XP, it will only use the LogonServer (the domain controller that was used when logging in to Windows). I've encountered cases where that domain...

Encrypting messages sent to a WCF services hosted on a server with real IP

I have a WCF Service hosted on a server with Real IP but no domain name. Clients are .NET desktop applications. I need to encrypt the data going back and force between the clients and the server. How can I do that? I understand that Certificates required for the SSL connection need a domain name. is this accurate? What options do I have?...

.NET Logger libraries. Your choice

What logger library you use in .NET projects and the one you prefer? I used log4net for a while, but it's last version is 2007. What is your personal choice and your opinion if you had hands on several libraries? Is there a logger library that is production standard nowadays? Thank you in advance! ...

Working with .net 4.0 on Biztalk 2006 R2

Hello, I am working on Biztalk 2006 R2 (With ESB guidance 1.0) I recently ended a development of a new model (Dot net model) on VS 2010 with dot net framework 4.0, the new model uses 4.0 features and cannot be downgraded. I have found out that the GAC was changed in the new 4.0 framework and is placed in a diffrent location (link text) ...

Sending variables from C# to VBScript

Hello, is it possible to send variables from C# to a VBScript file? Then send variables back to C# after the script is executed. Thank you ...

How to declare generic event for generic delegate in c#

I have a user control which deals with fileupload. I have defined a delegate as follows public delegate void FileUploadSuccess<T>(T value,FileUploadType F) value can be a string as well as byte array. FileUploadType is an enum which tells which type of file was uploaded. Now i have declared a event in usercontrol to raise this. publ...

Stop EffiProz from producing text files

I'm using EffiProz to work with database in a small app. The thing is, whenever the app run, it produce a text file with all executed commands inside. How to stop it from producing text files? ...

How to open socket thru proxy server in .Net C#?

How to open socket thru proxy server in .Net C#? So I opened up a socket on my machin. there are no nats between pe and proxy server. I connected to proxy server. How now to make Requests from global IP world that know that proxy server adrress be redirected or transfered by proxy server to me? Any libs blog articles? Please help ...

How to connect to a SQL Server Compact from a .NET application?

I would like to create a WPF application that is using a local database. I have created a simple database and added it so I can see my database NameDB.sdf in my Solution Explorer. How do I connect to it from my application? I have tried with an empty application that just tries to connect to the database: ... using System.Data.SqlServ...

How to learn transaction in EF or LINQ to SQL?

i try to learn transaction scope. Everything looks good. i try to control transaction is running i add 500 char in NAME value (Name nvarchar(50) normally). While My formApplication not running (it is normal), i try to open a table table is empty. Stop running my app form . i can see values of Tables. WHY? using (var ctx = new DataClass...

How do i handle static classes while using IOC

I just started migrating my web application to fully use Windsor IOC. Here is a little problem I am encountering; I have couple of static classes which I used to store some application level global values EG (Simplified version of the class): public static class SiteInfo { public static Language Language = (Language)byte.Par...

C# How to redirect stream to the console Out?

I found lots of samples how to redirect console output into a file. However I need an opposite soluiton - I have StreamWriter which I want to be shown in the Console output once I do sw.WriteLine("text"); ...

Why Would an Out of Memory Exception be Thrown if Memory is Available?

I have a fairly simple C# application that has builds a large hashtable. The keys of this hashtable are strings, and the values are ints. The program runs fine until around 10.3 million items are added to the hashtable, when an out of memory error is thrown on the line that adds an item to the hasbtable. According to the task manager, ...

Images in WPF 4.0 are of lesser quality than in 3.5

Hello, I just updated my app to .Net 4.0 from 3.5sp1 Which included removing references to the toolkit and exhange them with system.xaml. Some more reference changing was required by me but I dont quite recall what they were. Anyway, after I compiled and run it the the first thing that popped into my eyes is that all the images seem wors...

C# fine-grained permissions: multiple internal systems, intranet scenario

Hello all, I have the following scenario: Multiple users (< 100) User accounts in AD (under different groups) Every group in AD corresponds to a internal department; each department have at least one supervisor (One may say) We have cross-supervisioning (there are supervisor roles appliable to group of groups, i.e., there may be one s...

Returning a single row in a strongly typed DataSet in C#

I have a Strongly typed Dataset TableAdapter in C#, how do I get a single row from it? ...

WPF BooleanToVisibilityConverter that converts to Hidden instead of Collapsed when false?

Is there a way to use the existing WPF BooleanToVisibilityConverter converter but have False values convert to Hidden instead of the default Collapsed, or should I just write my own? I'm on a project where it's tremendous overhead to do something simple like this (shared stuff goes into a separate solution, and the rebuild/checkin/merge...

VS2010 - Drop-Bug while Debugging?

Hi, I created a ListBox in WPF (.NET 4.0) with "AllowDrop = True". When I start debugging the drop is not accepted, but when i build the project and run it from explorer all wors fine. Have you made equal experiences? ...

Creating a webserver in C#

I'd like to create a web server that responds to every incoming request with a simple "Hello" message in C#. How do I do that? ...