.net

Completely halt application when showing a "you have crashed, we are sorry ..." popup

If my application crashes, I intercept the crash (using the function SetUnhandledExceptionFilter). In my crash handler, I create a mini dump file, and notify the user that his application has crashed. This notification is done via a MessageBox with the flag MB_TASKMODAL so the rest of the application is blocked. Unfortunately, that do...

Is the StaticFactory<T> in codecampserver a well known pattern?

CodeCampServer source code contains a generic StaticFactory. I'm surmising that this is a key piece of the mechanism for how the framework plays well with Dependency Injection. Subclasses of which use it's DefaultUnconfiguredState to provide static access to, well, a Default Unconfigured State for themselves which the dependency resolu...

WCF Xml vs Binary Serialization Pros and Cons

I know that if I use binary serialization with WCF I lose interopability. If I'm willing to live with this I was wonderinf if there is an efficiency benefit in using binary over Xml. And if there are any other pros and cons that I have not mentioned above ...

Field initialization

I'm just curious, are there any diferences between this two ways of field initialization ? When to use wich one ? Fist way public class Class1 { private SomeClass someclass; public Class1() { someclass = new SomeClass(some arg); } } Second way public class Class1 { private SomeClass someclass = new SomeClass(s...

What WCF logging should I enable to help track down why a channel is being faulted?

The WCF channel is somehow getting into the faulted state in the client, what WCF logging show I enable to help track down the reason? How do I enable the given logging from code? (The channel etc is setup in code rather than a config file on each side) Edit: Both sides are Winforms applications, so I don’t have a web.config file, ...

How do I control WCF logging from a log4net config file?

We do all our logging with log4net, our support staff etc know how to edit the log4net config files. We are now making use of WCF in our apps. Therefore how can I enable the WCF built in logging to be controlled from the log4net config file, so that there is a single way to control all logging. ...

Desktop Multithreading UI sample application for .net

Are there any good sample UI applications which illustrate multi threading best practices in .net? The scenario I am thinking of is a graphically rich scorecard where the kpi's are being updated from several different sources and threads. Although I am interested in WPF a Winforms sample application would I believe serve just as well ...

How is the thread-pool handled when using System.Timer objects in multiple threads?

Ok, I know an object of System.Timer executed in the thread-pool, rather than in the UI thread. I also know that the System.Timer is thread-safe. Say I have a collection of System.Timer objects. I can have all of them run and (unless i'm mistaken) they'll actually execute in the thread-pool. Say I instead create a collection of thre...

When does a dictionary throw an IndexOutOfRangeException on Add or ContainsKey ?

On a busy ASP .NET website, I have a Dictionary, which acts as a cache, basically storing key/value pairs for later retrieval. On high load, the Dictionary some times get into a state, where it always throws an IndexOutOfRangeException whenever i call the ContainsKey or Add method. The exception happens inside the private FindEntry meth...

Send page by email ViewState issue

Hi, My client wants a page that they can send as an email through IE, but when I do File>Send>Page by Email it adds a hidden input field at the top of the page with some random letters in it. I've been asked to remove it... I've tried EnableViewState=false and removing it from the dom with javascript and even hiding it with CSS but i...

displaying address on pin drop in map

Hi, Currently in my map code pin is dropping at current location and on pin click address is displayed. I want to display address without user interaction. How to do it? ...

Java client for .Net WCF service

Have you ever heard or had such experience? Are there any known issues in such a scenario, that does not exist in .Net client scenario. I guess development in such a scenario will not be as smooth as in .Net client. Share your experience please. ...

Singleton or not

Hi there.. I have a windows service running.Inside this service I have hosted some service (WCF). I need to have some kind of a "in memory data holder" class. The purpose of this class is to hold not-persistant data as long as the windows service is running. This class must be accessible thru the WCF services. They put some values in t...

.Net Framework Prerequisite requirements if application build with .net 3.5 SP1?

What all versions need to be present on a user machine if I want to install an application (desktop wpf) made mostly out of .net 3.5 SP1? From your experiences ? ...

Compiling C# to Native?

I think I'm somewhat confused about compiling .NET byte-code to native code, or maybe I'm confused about the end result. So please bear with me as I try to sort through what I think I understand so you can help me figure out what I'm missing. What I'd like to do is compile my application written in C# down to regular native code like I...

Resharper says I need to reference a dll, which is already referenced. code compiles ok.

I have a strange problem with resharper. I have a project file which is modified so that references are made by using an environment variable like so: <Reference Include="$(DllLocation)My.Companies.dll"> <Private>false</Private> </Reference> The project references another project, which also has the reference to the same dll in the...

Further questions on Searching subdirectories in C#

I asked a question recently on searching directories in C#. Program Logic List all the directories in a string, or multiple strings. Try to copy the file out using the string. If it fails, proceed to the next string, If it succeeds in finding the file: copy skip to next entry in text file End Result If it finds it on the ...

How do you properly override DataGridViewCheckBox.Value?

I'm trying to override a DataGridViewCheckBox so that it takes it's boolean value from whether an object is in a collection (essentially a predicate), and when the value is set it adds/removes the object from the collection as appropriate. Furthermore, I want this value to be checked when the checkbox is displayed (but I can't set Valu...

Java and .Net interoperability

I'm attempting to use the WebI ReportEngine SDK (AKA RENET) to change the Universe that is assigned to a WebIntelligence (WebI) rpeort. Much research led me to the changeDataSource() method (exposed by the Java version of the SDK, AKA REBean). Unfortunately, the changeDataSource() method isn’t available in the .Net version of the WebI ...

.net masterpage .cs cannot find control on .aspx page

I have a masterpage that I am reusing to create a new project. It works perfectly in project A. However, in project B I am getting a compile error saying the control does not exist in the current context. It baffles me. On the aspx page the control looks like: <asp:Menu ID="Menu1" Orientation="Horizontal" runat="server...