.net

Can Window application continue to run despite computer going to standby mode?

I am developing a Windows application using C#.net. This will accept the login details, validate the login and then keep running unattended till the time the computer is on. This computer won't do anything else and go to standby mode after a few minutes as per the security policy. Is there a way to configure my application to avoid goi...

What will happen if I set CurrentCultureInfo to en-us

I am using a client application which connects to a remote Database in US. there are some datetime ambiguities that comes up in the result like if date is 14 Jan in database its returned as 13 Jan. What I would like to know If I Set the CurrentCultureInfo of my Client equal to my Servers will that solve the issue. If this can be done....

Spring.Net IoC Application Context Problem

Hi, I'm having the following "problem". I created a application context file for spring.net. The configuration looks like this: <spring> <context> <resource uri="config://spring/objects"/> </context> <objects configSource="SpringObjects.config" /> </spring> I was told that if you change something to the application context you...

Guidelines to write C# applications for .NET and mono

Mono claims to be compatible with .NET. Have you tried it? Can you share any tips or guidelines for making a running .NET application compatible with mono? ...

LINQ to SQL: Mapping a subset of an association

During our initial development we haven't worried about scaling concerns, just getting the bare bones of the system working as a cohesive whole. We are now looking at refining screens where the quantity of records will become too large to be displayed. For example, we have page for displaying the details of a Parent which currently invo...

How do you install files in the assembly in Windows Server 2008?

Typically what I used to do is drag and drop the files onto the GAC folder. This works in Windows 2000 & 2003, however when I try to do this in Windows Server 2008 I get 'Access is denied'. The user that is doing this is a local administrator. The only reference I can find to this is: Forum link Is there another way to achieve this? ...

How can I get the VS add-in to write to the Output window?

I want to get my add-in to write to the Output window in Visual Studio. How can I do it? Found the answer here: http://www.knowdotnet.com/articles/outputwindow.html&#160;–&#160;Dmitri Nesteruk ...

Wix and .NET Framework (prerequisites)

How can I have my Wix package to download the required .NET Framework when it's not yet installed in the client's machine? I already have the condition to check for the installed .NET version but I'm not sure how to have it downloaded and installed when not found. ClickOnce does this automatically by checking the pre-requisites in the p...

WPF v/s System.Drawing

I have to code a simple control in .Net that draws geometry that looks like following image and the geometry doesn't get any more complex than shown in this image, i.e. it will be a few filled polygons and some dashed lines. This is not a static image however, that is drawn once and forgotten. The dimensions of the geometry can changed b...

.NET Framework weaknesses to be avoided

Dupe: http://stackoverflow.com/questions/411906/c-net-design-flaws#411919 When I learnt the .NET Framework, I was pleased with the direction Microsoft was/is taking with their application development vision. There was a great sense of enjoyment and excitement developing on the .NET platform, with some areas delivering truly impressive c...

How does object reuse work in .NET?

I've recently moved from VB6 to VB.NET and I am finally getting there with understanding the inner workings. I've been looking at my company's existing codebase and I am a little suprised. I understand that when VB.NET creates a string it see's if the string is in memory and if not creates a new instance of that string, otherwise it po...

How to execute a command in a remote computer?

I have a shared folder in a server and I need to remotely execute a command on some files. How do I do that? What services need to be running on the server to make that work? Some details: Only C# can be used. Nothing can be installed in the server. ...

Is referencing an implementing base type in an interface a code smell?

I'm faced with a design decision that doesn't smell to me, but gives me pause. Take a look at the following code sample: public interface IGenerator { ///<summary> /// Combines two generators; performs magic as well /// </summary> BaseGenerator Combine(BaseGenerator next); ///<summary> /// Does what a generator does. ///...

Microsoft Office Document's Viewer Component

We need a user control that can show Microsoft Office files (Word, Excel..). There is no need for editing them. As I can see, there are available standalone viewer applications that can be downloaded from Microsoft site, but I am wondering if it could be embedded within an user control. I think that there could be a COM/ActiveX compone...

Select either a file or folder from the same dialog in .NET

Is there an "easy" way to select either a file OR a folder from the same dialog? In many apps I create I allow for both files or folders as input. Until now i always end up creating a switch to toggle between file or folder selection dialogs or stick with drag-and-drop functionality only. Since this seems such a basic thing i would im...

Recommendation for high performance WPF Chart

We're working on a WPF-based desktop application that charts financial markets information (candlestick charts, overlayed indicator curves, volume, etc). The charts are displayed in real-time with responses to market ticks being shown in real-time (updating one to two times per second is probably a reasonable display refresh policy). W...

storing check box state in database with bitwise operation?

let say you have between 35 and 50 checkbox on a form. would you create 2 tables: accessTable, field: userid, accessType accessLookup, field: accessType, description and add X and/or remove rows to accessTable depending on the user selection OR would you create 2 tables: accessTable, field: userid, haveAccessBit accessLookup, fi...

Business reporting with per-page print control

Does anyone know of a reporting tool that allows for controlling the print job on a page by page basis? Specifically, I need to be able to insert escape sequences to the printer. The closest I have found is ActiveReports. It provides an interface like this: SystemPrinter sp = new SystemPrinter(); sp.StartJob("jobname"); foreach(Pag...

Do you accept interfaces as constructor parameters?

Does Krzysztof's recommendation apply to constructors? If so, how do you implement it properly? We recommend using Collection, ReadOnlyCollection, or KeyedCollection for outputs and properties and interfaces IEnumerable, ICollection, IList for inputs. For example, public ClassA { private Collection<String> strings; publi...

Managing complex Web.Config files between deployment environments.

Does anyone know of any good tools/utilities for managing Web.Config files between different build/deployment environments? For example, I have a WCF project that in development I don't want to enable SSL, but I do want it enabled in production. I want different logging settings, different DB connection strings, different error handlin...