.net

Dynamic programming with WCF

Has anybody got any kind of experience with dynamic programming using WCF. By dynamic programming I mean runtime consumption of WSDL's. I have found one blog entry/tool: http://blogs.msdn.com/vipulmodi/archive/2006/11/16/dynamic-programming-with-wcf.aspx Has anybody here found good tools for this? ...

How to use 32bit alpha-blended BMP in .Net

Hi, Is there any way to use this kind of format in .Net (C#)? I want to use the same skin format that uTorrent uses in my app, but i can't get the transparent background. Any ideas? Thanks for your time. ...

Is there a class to generate a sample XML document from XSD schema in .NET

In Visual Studio you can create a template XML document from an existing schema. The new XML Schema Explorer in VS2008 SP1 takes this a stage further and can create a sample XML document complete with data. Is there a class library in .NET to do this automatically without having to use Visual Studio? I found the XmlSampleGenerator artic...

Instance constructor sets a static member, is it thread safe?

I am refactoring some code and am wondering about the use of a 'lock' in the instance constructor. public class MyClass { private static Int32 counter = 0; private Int32 myCount; public MyClass() { lock(this) { counter++; myCount = counter; } } } Please confirm Inst...

Recommendation for 3rd party editing/syntax highlighting control - WinForms.

I'm looking for a quality WinForms component that supports syntax highlighting, code folding and the like. The key criteria are: 1) Stability 2) Value (price) 3) Ability to easily customize syntax to highlight 4) Light weight ...

Maintain the correct version for a COM dll referenced in a .NET project

I want to reference a COM DLL in a .NET project, but I also want to make sure that the interop DLL created will have the correct version (so that patches will know when the DLL must be changed). If I use TlbImp I can specify the required version with the /asmversion flag but when I add it directly from VisualStudio it gets a version tha...

What is the best EXIF library for .Net?

I am looking for simple straightforward solution for accessing EXIF information of jpeg images in .Net. Does anybody has experience with this? ...

.NET YAML Library

Anyone know of a lightweight YAML library for .NET? Preferably something that comes with source (in C#) so that I can compile it directly into my binary and not have yet another dll dependency. ...

Easy .NET XML Library

Following my question regarding a .NET YAML Library... as there doesn't seem to be great support for YAML in .NET, are there and good open source really simple .NET XML libraries. I just want something where I can pass it a section name and a key and it gives me the value as well as being able to give me a list of all the current sectio...

How can I unit test a Windows Service?

.NET Framework: 2.0 Preferred Language: C# I am new to TDD (Test Driven Development). First of all, is it even possible to unit test Windows Service? Windows service class is derived from ServiceBase, which has overridable methods, OnStart OnStop How can I trigger those methods to be called as if unit test is an actual service t...

Whither Managed Extensibility Framework for .NET?

Has anyone worked much with Microsoft's Managed Extensibility Framework (MEF)? Kinda sounds like it's trying to be all things to all people - It's an add-in manager! It's duck typing! I'm wondering if anyone has an experience with it, positive or negative. We're currently planning on using an generic IoC implementation ala MvcContrib fo...

What's the best way to read the contents of a text file to a string in .NET?

It seems like there should be something shorter than this: private string LoadFromFile(string path) { try { string fileContents; using(StreamReader rdr = File.OpenText(path)) { fileContents = rdr.ReadToEnd(); } return fileContents; } catch { throw; } } ...

Suggestion for some .NET training

Is there any training that you would recommend for someone looking at doing more with .NET? Does IBM have any good trainings? More specifically, C# and web application development. While I have written a couple applications, I want something that can give me a better solid base on developing in .NET. I'll be supporting our web developer ...

What's wrong with this code? If anything.

Essentially I want to know if in VB.NET 2005 if using a sqlcommand and then reusing it by using the NEW is wrong. Will it cause a memory leak. EG: try dim mySQL as new sqlcommand(sSQL, cnInput) // do a sql execute and read the data mySQL = new sqlcommand(sSQLdifferent, cnInput) // do sql execute and read the data catch ... final...

How do I Convert an IntPtr to a Stream?

class Foo { static bool Bar(Stream^ stream); }; class FooWrapper { bool Bar(LPCWSTR szUnicodeString) { return Foo::Bar(??); } }; MemoryStream will take a byte[] but I'd like to do this without copying the data if possible. ...

Custom titlebars/chrome in a WinForms app

I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked. Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know that one way to accom...

How do I measure bytes in/out of an IP port used for .NET remoting?

I am using .NET remoting to retrieve periodic status updates from a Windows service into a 'controller' application which is used to display some live stats about what the service is doing. The resulting network traffic is huge - many times the size of the data for the updates - so clearly I have implemented the remoting code incorrectl...

Thread-safe use of a singleton's members

I have a C# singleton class that multiple classes use. Is access through Instance to the Toggle() method thread-safe? If yes, by what assumptions, rules, etc. If no, why and how can I fix it? public class MyClass { private static readonly MyClass instance = new MyClass(); public static MyClass Instance { get { retur...

Which Dynamic .NET language makes more sense to learn, Iron Ruby or Iron Python?

I'd like to take some time to learn more about dynamic languages built on top of the DLR and I'm not sure which language would be better to learn. Having limited time, I really only have time to look learn one of them. Any opinions on which of the two (Iron Ruby or Iron Python) would be more useful in the long run? Thanks! ...Ed ...

What is WCF?

Can someone please explain in simple terms what WCF is? It's hard to distill the meaning from the Wikipedia page. ...