.net

IIS7 / WPAS: Multiple WCF services in same AppDomain?

If host my WCF services in IIS7 or WPAS, is it possible to load up two or more services into the same AppDomain so that they can share static variables? ...

Image resizing in .Net with Antialiasing

I've got some C# code that resizes images that I think is pretty typical: Bitmap bmp = new Bitmap(image, new Size(width, height)); Graphics graphics = Graphics.FromImage(bmp); graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.SmoothingMode = Smoothin...

How to include COM components on a published .Net site?

How to include COM components on a published .Net site? ...

which is the best .net library for google maps api?

I need an up to date and easy to use .net wrapper for google maps. ...

Why can't I define a default constructor for a struct in .NET?

In .NET a value type (C# struct) can't have a constructor with no parameters. According to this post this is mandated by the CLI spec. What happes is that for every value-type a default constructor is created (by the compiler?) which initialized all members to zero (or null). Does anyone know why it is disallowed to define such a defaul...

Passing web context to a 'service' in ASP MVC app

Hi I'm trying to work out a way of passing the web current http context to a service class (or initialising the class with a reference to it). I am doing this to abstract the rest of the app away from needing to know anything about the http context. I also want the service to be testable using TDD, probably using one of the Mockable f...

Will Request.UserHostName always give me the user's computer name?

Basically I want to make sure I will always get the computer's name rather than any proxy or other hardware imbetween. ...

Working with ADO.NET Entity Objects and Soap-based Web Services

Hello All, I'm building a traditional ASP.NET Web Service -- the style built using asmx. It's a pretty simple service. I started using the new Ado.NET Entity Framework for my persistence layer, and I'm running into some problems: 1) I don't like the WSDL that gets automatically generated -- the complex types were getting defined as...

C# equivalent to Java's Exception.printStackTrace()?

Is there a C# equivalent method to Java's Exception.printStackTrace() or do I have to write something myself, working my way through the InnerExceptions? ...

Remoting performance degrades over the time

Hello, I'm working on a client-server solution that uses .NET 2.0 Remoting (server activation, binary formatting over TCP channel, Vista Ultimate) for communication purposes. Currently I'm profiling the application and run everything on the same machine. I noticed that if I start the application, everything works just fine for several m...

"Perfect" .Net Dev Environment?

I've been given an early Christmas Present: Permission to step out of the development cycle to reorganize and document our application. I have complete freedom to restructure, refactor, and set up any amount of infrastructure I see fit. I'm hoping to draw on the collective StackOverflow wisdom wrought in greater experience and s...

Which StyleCop rules should I follow when writing a open source library.

I am currently writing an open source wrapper for a COM object. I have just installed StyleCop and run it against some of my code, and as I expected it threw up a load of warnings (some of which I should have been doing already eg adding "this." to all local method calls and variables) How many of these warnings should I try and reduce...

Crystal Reports vs. WinForms issue

I have a WinForms app (written in VB.NET if that detail matters) which has an embedded Crystal Report for tracking application utilization (let's call it utr310.rpt). Our reporting guy made a minor tweak to the report that has been in production and I'm trying to test with it (let's call the new one utr311.rpt) except that I'm getting th...

Calculate the next anniversary date after today.

What's the quickest/neatest way to calculate the next anniversary of someone's birthday. For example, if I knew a person was born on 31st January, 1990, and today is the 10th February 2000, their next anniversary will be 31st January, 2001. February 29th should roll onto March 1st (e.g. if they were born on February 29th 1990, their fi...

How to build only a handful of projects contained in a solution using MSBuild?

I am trying to setup a TFS Team Build and am new to MSBuild. I have a solution that contains a few projects (MyProject1, MyProject2, ..). I find that setting up the team build I could only select which solution should be built and when performing the build the build target for all the projects becomes the same and the output for all proj...

How do I add a custom XmlDeclaration with XmlDocument/XmlDeclaration?

I would like to create a custom XmlDeclaration while using the XmlDocument/XmlDeclaration classes in c# .net 2 or 3. This is my desired output (it is an expected output by a 3rd party app): <?xml version="1.0" encoding="ISO-8859-1" ?> <?MyCustomNameHere attribute1="val1" attribute2="val2" ?> [ ...more xml... ] Using the XmlDocument/...

How do I check "Allow IIS intrinsic properties" in a COM+ application programmatically?

Component Services -> Computers -> My Computer -> COM+ Applications Open a COM+ Application object. Open Components. Right-click on a class and select Properties. Under "Advanced" there is a check box for "Allow IIS intrinsic properties". How do I check this check box programmatically? I can create and delete COM+ Applications prog...

log4net - When to use 'nested diagnostic context' (NDC)?

Playing with log4net, I have seen the possibility to use a per-thread stack of context labels called the NDC. The labels pushed on this stack are displayed in a PatternLayout by specifying the %x or the %ndc format parameter. The usage is something like: ILog log = log4net.LogManager.GetLogger(...) ; //pattern layout format: "[%ndc...

UserControl's RenderControl is asking for a form tag in (C# .NET)

I asked how to render a UserControl's HTML and got the code working for a dynamically generated UserControl. Now I'm trying to use LoadControl to load a previously generated Control and spit out its HTML, but it's giving me this: Control of type 'TextBox' must be placed inside a form tag with runat=server. I'm not actually adding the ...

Design Pattern: Parsing similar, but differing schemas in text files.

Hi there, thanks in advance for your help. I am wondering if there is a (design) pattern that can be applied to this problem. I am looking to parse, process, and extract out values from text files with similar, but differing formats. More specifically, I am building a processing engine that accepts Online Poker Hand History files fr...