.net

Opinion on Making a Common Utility Class Static

Some of what I've been reading about this yesterday and today: (SO) Should you avoid static classes? (SO) When to Use Static Classes in C# - Mark S. Rasmussen makes a nice comment here Singleton vs Static - Nice quote from here: These differences are extremely subtle but they do impact how resilient the system will hold up after years ...

Is it possible to convert a SoapException to a FaultException with WCF?

I am migrating a web service client from WSE to WCF. I already modified the internal fault and error handling to deal with FaultExceptions instead of SoapExceptions. The project has an extensive suite of test cases to test the fault and error handling which still relies on SoapException. For various reasons, I'd prefer not to rewrite t...

System.IO.FileLoadException

Getting "System.IO.FileLoadException: Unable to load file or assembly" when trying to bind localized resources assembly from the separate project. Fusion Log shows: ERR: Setup failed with hr = 0x80070005. ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing terminated. Trying to solve this for 3 hours already,...

How to fast get Hardware-ID in C#?

I need in my license Program use hardware id ,I tried use WMI,but it still slow . I need Cpu,HDD,Motherboard info. ...

How to develop a form in windows forms similar to the "outlook 2007 send/receive progress" dialog?

I want to develop a dialog using windows forms in C# that resembles the "outlook 2007 send/receive progress" in behavior. I developed most of the functionality but am having trouble when I need to implement the "Details" button function. Essentially, the dialog has a progress bar and tabbed panel below the progress bar. on the right o...

Working with webresource in asp.net, application running on localhost but not on web server

I am building an application where i am using a web resource for implementing captcha. When i runs this application on my localhost, it run successfully but when i tries running it live then no image gets displayed in captcha. This is my live application where no image is being displayed. But it is running successfully on localhost. W...

Are custom config sections dependencies that should be injected?

Also, how do connection strings fit in? Presumably, it is ok for the dal to read these values from the config, or should these be passed down from the top? ...

.NET TAPI Interface

I’ve been asked to write some .NET code that integrates with a phone system using a TAPI API. I read that there is no .NET interface for this API ( http://support.microsoft.com/kb/841712). Is there good third party .NET interface for TAPI? Or can anyone point me in the right direction to get started? ...

XmlDocument::Save() appends the xml in file

I want to keep a single XmlDocument object in a class and let methods make changes to it and save it. using (FileStream fs = new FileStream(@"D:\Diary.xml", FileMode.Open, FileAccess.ReadWrite, FileShare.Read)) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fs);...

Undo/Redo using Memento: Stack, Queue or just LinkedList?

What is the best having when implementing Memento pattern (for Undo/Redo) in witch collection to Keep Mementos? Basically, I need this(c = change, u = undo, r = redo): 0 *c -1 0 *c -2 -1 0 *c -3 -2 -1 0 <u ...

Problems with data types from external dll

I use Philip's MfRc500.dll for communicating with RFID chips. It contains a function for reading data, which is defined like this: signed char Mf500PiccRead(unsigned char addr, unsigned char * data) I use it in VB.NET like this: Private Declare Function RFID_PiccRead Lib "MfRc500.dll" Alias "_Mf500PiccRead@8" (ByVal addr As UShort, B...

Click Once and ActiveX

I have my "clickonce" windows form app working except for the installation of a com "ActiveX" element. The users machines have almost no permissions ie they cannot install or even navigate to a website outside one. I am a little stumped as to how include the activex control without registering or installing it. Has anyone else ran into t...

Lamda Explanation and what it is as well as a good example

Can anyone give me a good explanation of how to use Lamda and give a good example. I have seen it but I dont know what it is or does. ...

C# and VS.NET : Cannot assign property of struct returned from method

I got the following error which I translated from german: error BC30068: The Expression is a value and cannot be target of an assignment. Iam trying to do the following: sheet.Cells(row, col).Value = newVal ' this is VB Where I have declared Cells as: public Cell Cells(int x, int y) // this is C# { return new Cell(this, x, y); ...

Functions scope at a file level in C#/.NET?

I have many many functions (100+ estimated) and more then half are only needed in the file its defined. Is there a way to define functions so it scope is at a file level? ...

extract all email address from a text using c#

is there a way to extract all email address from a plain text,Using C# . eg my email address is [email protected] and his email is [email protected] should return [email protected],[email protected] I have tried following but it matches perfect emails only. public const string MatchEmailPattern = @"^(([\w-]+\.)+[\w-]+|([a-zA-Z...

Does anyone have any stats or thoughts on Performance of WPF on 64bit OS?

I see lot of new machines and laptops now having 64 bit hardware and provided all drivers are correct, will WPF and corresponding .NET will run any faster on 64 bit machines? I dont see any documentation about .NET or WPF on 64 bit anywhere, but I would like to know the difference. I see that .NET has no specific API for 64bit architectu...

WebService logging

Hi, I would like to log every request that arrive to my webservice, end to log every response. I mean, the incoming and outgoing text stream. So far I've been able to log the SOAP requests and responses, but the ones which sends a browser, I coundn't. I tried to implement the IHttpModule interface, and handle the HttpApplication.BeginRe...

Immediate Window automatic cleaning in Visual Studio

Hi. I have a question about debugging in Visual Studio. Is it possible to clear the Immediate Window in Visual Studio automatically before each startup of a debugged application? The >cls command and Context Menu->Clear All are useful, but they are not automatic and require personal attention each time I run the application. Again, Syst...

Visual Studio registry capture utility has stopped working, error compiling C# project in Windows7

Windows 7 Shows build error like below everytime I compile my project. ...