.net

Which libraries have been ported to different programming languages?

Since I am working with different Platforms and programming languages, I found there are many good libraries that are ported with different programming language than its original. For example JUnit and Log4j which has been ported into several different languages. Sometimes if I am already used to working with these libraries, I would fin...

Is it possible to develop ".NET framework 4.0" [beta] apps with Visual Studio 2008?

Is it possible to develop .net 4.0 [beta] apps with Visual Studio 2008? I tried Visual Studio 2010 few days after ms released it, and managed to crash it few times in one hour :( and wouldn't use it anymore if it's not more stable now => have MS released any bugfixes? ...

ClickOnce problem with Update and the Query String

I'm working on a ClickOnce deployment where the application accepts a query string parameter. The problem is, ClickOnce is seeing the query string as a different URL so when I try to launch the application again without the query string or with a different query string I get the error saying it was installed from another location. Here ...

TabWorkspace in flotting window using C#

I am using .net Smart client framework with CAB to develop window based application. I want to add flotting window into tab workspace ...

Use Windows Explorer in .NET code?

Hi, Does anyone know if it's possible to use the bits and pieces of Windows Explorer in .NET code? That would be nice, for example, to write file management forms in other programs, and get that to look just like the explorer, and "follow" the different Windows versions. ...

.NET 2.0 code - Unit testing with MoQ

Hi, I am building a .NET 2.0 codebase, and i want to use any test framework library for unit testing the .NET 2.0 codebase. There are some build using .NET 3.5, is it still OK i use it as my unit testing tool to test .NET 2.0 code? ...

How to check whether Primary Interop Assemblies are installed or not?

Hi, I am "using" Microsoft.Office.Interop.Excel in my C# code. I want to use the code related to Microsoft.Office.Interop.Excel only if PIA for Excel is installed on that machine. But, I get exception when I call that function (which uses Excel Interoperability) Why am I getting exception even if that code actually isnt getting calle...

.Net equivalent to Java's AssertionError

In Java, I will occasionally throw an AssertionError directly, to assert that a particular line will not be reached. An example of this would be to assert that the default case in a switch statement cannot be reached (see this JavaSpecialists page for an example). I would like to use a similar mechanism in .Net. Is there an equivalent ...

CLSCompliant(true) drags in unused references

Can anyone explain the following behavior? In summary, if you create multiple CLS compliant libraries in Visual Studio 2008 and have them share a common namespace root, a library referencing another library will require references to that library's references even though it doesn't consume them. It's pretty difficult to explain in a si...

System.Threading.Timer

Hi I am new to VC++ .net programming. Please help me out how to use System.Threading.Timer in a windows service VC++ .net code. I tried using form.timer and system.timer class but as it turns out it's a known windows bug and it won't work reliably. I am not able to use system.threading.timers. Please give an example. Nitin ...

Why does MarshalByRefObject.InitializeLifetimeService return an object and not an ILease?

I am reading through the msdn docs for .NET Remoting and noticed that the MarshalByRefObject.InitializeLifetimeService method returns an object instead of an ILease. The documentation says that the method returns an object of type ILease and all code examples I have found casts the returned value to an ILease. But the methods signature s...

How to add optiongroup in asp:listitem

Hi, How can I add optiongroup in asp:listitem. Please give some example code. ...

How can I set fixed XAxis points in MS Chart Contol?

Hi! I use a MS Chart fo .Net 3.5 sp1 in my project. I want to show charts that always have fixed x axis labels no matter if there exists a value for that point or not. For example I want the values 1,2,3, 4 and 5 always visible on x axis even if the data series visible consists of points eg. (1,3), (2,2) and (5,4) - so 3 and 4 are mis...

How to force a .net form control (eg a button) to be always rectangular ?

How to force a .net (under ms windows) form control (eg a button) to be always rectangular ? I want it to be able to change it's size but be always rectangular. ...

How to find the Method Name of the calling method from a method at runtime ?

For example: Class A { M1() { B.M2(); } } class B { public static M2() { // I need some code here to find out the name of the method that called this method, preferably the name of the declared type of the calling method also. } } ...

How do I specify XML serialization attributes to support namespace prefixes during deserialization in .NET?

I have a following XML: <person xmlns:a="http://example.com" xmlns:b="http://sample.net"&gt; <a:fName>John</a:fName> <a:lName>Wayne</a:lName> <b:age>37</b:age> </person> How do I define XML serialization attributes on a class to support described scenario? ...

Retrieve Html attributes using Regex

I'm in need of a quick way to put a bunch of html attributes in a Dictionary. Like so <body topmargin=10 leftmargin=0 class="something"> should amount to attr["topmargin"]="10" attr["leftmargin"]="0" attr["class"]="something" This is to be done server-side and the tag contents are already available. I just need to weed out the tags w...

WPF supports touch or multi-touch screen?

Hello everyone, I am wondering whether WPF on .Net 3.5 supports touch or multi-touch for laptop? Appreciate if there are some cool Demos to show the effect. I am using VSTS2008 + C#. thanks in advance, George ...

changing a dll manifest

I got a complete vs2005 project from our sub-contractor, which depends on several of their other projects. I didn't get those projects' source files, but I do have their dlls in the bin/debug folder (lets call them a.dll and b.dll). I copied those dlls into a \lib folder, and changed the references to point there. The problem I have now ...

Change in AppSettings needs restart my Application how can I avoid?

I'm using C# .NET 2.0 Windows Application. and I'm using app.config for my Application Settings. but change in AppSettings doesn't reflected runtime, it Needs Application to be restarted. How can I avoid it. Here is my code snippet I used to read and write the Application Settings. I'm reading the Setting like this string temp = Co...