.net

.NET CLR that does not require an operating system?

In the world of Java, BEA (now Oracle) has created LiquidVM which doesn't require an OS. Likewise, there are a variety of open source projects including SANOS, JNODE OS, Project Guest VM, JavaOS, etc. Is there an equivalent being created for .NET? ...

.NET Application domains and ASP.NET

We all know that the .NET architecture introduced the concept of application domains. ASP.NET creates an application domain for each Web application that runs on a Web server. With a process viewer, you will not see the process for individual web applications executing because there's no new process created for them. How can I view the...

Problem with SOAP response structure from Coldfusion webservice

I have a problem with a Coldfusion webservice I've created. The service accepts XML data, BASE64 encoded, and then writes it to disk for archive purposes. This file then undergoes a basic schema check and any errors are reported back to the user as follows: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ...

Why is SvcTraceViewer included into Windows SDK and NOT to .NET Framework tools?

It is a WCF tool and why it is located within Windows SDK and not inside the .NET Framework? ...

Why in this example using floats makes me go 2x slower than with doubles?

I've been doing some profiling lately and I've encountered one case which is driving me nuts. The following is a piece of unsafe C# code which basically copies a source sample buffer to a target buffer with a different sample rate. As it is now, it takes up ~0.17% of the total processing time per frame. What I don't get is that if I use ...

How do I install XamlPad?

This is going to sound silly, because everyone seems to take it for granted that XamlPad is just there, including the MSDN article about XamlPad. But I've installed Visual Studio 2008, which AFAIK installs the .NET 3.5 SDK (how could it not?), which is supposed to include XamlPad. But there is no XamlPad.exe in my Start Menu or anywhere...

More robust file system library in .net

Let me rephrase. My example probably wasn't good. A lot of things can go wrong when deleting a directory. A file has a readonly attribute set, the directory is opened by the windows explorer. I guess all of them can be handled - however I don't want to do it on my own - is there a wrapper that takes care of that with a simple api? I fin...

Intellisense-like .Net Component?

Hello there, does anyone know of any 3rd party component that provides an intellisense like functionality (providing my own library of course) that I could use in my (custom) text editor in order to improve usability? Cheers & thanks, -J ...

Compiler warnings when overriding one method but not another

I would like to have a compiler warning when a class overrides one method but does not override a related function. How do you do this? For example, if you override Object.Equals you get a warning if you do not override Object.GetHashCode(). ...

Is it possible to statically include MSVCR90.DLL in managed apps?

Here is the situation - I developed my application in VC++ 2008, using Windows Forms/Managed Code. It runs fine. However, I need it to run on a Windows 2000 machine, and, if possible, not need any additional DLLs/installs aside from the 2.0 framework. I looked around, and most of the answers I got were about not needing MSVCR90.dll on ...

Using SubSonic Query to on multiple tables

I want to select rows from multiple tables using subsonic. For one table I can use Query object, but I don't know how I can add more than one tables to query. ...

How to refactor multiple similar Linq queries?

Suppose I have the two following Linq queries I want to refactor: var someValue1 = 0; var someValue2= 0; var query1 = db.TableAs.Where( a => a.TableBs.Count() > someValue1 ) .Take( 10 ); var query2 = db.TableAs.Where( a => a.TableBs.First().item1 == someValue2) .Take( 10 ); Note that only the Where ...

Binding converter as inner class?

I have a UserControl that uses a binding converter. I've made the converter an inner class of public partial class MyPanel : UserControl { public class CornerRadiusConverter : IValueConverter { How do I reference the Converter class from the XAML? The following does not work: <controls:MyPanel.CornerRadiusConverter x:Key="Cor...

Changing fields to property is a breaking change under what scenarios?

While reading Jon Skeet's article on fields vs properties he mentions that changing fields to properties is a breaking change. I would like to understand the common scenarios in which this change can cause breaks. Along with the scenario, if you can, please provide any details. For starters, the following points have been mentioned els...

Wpf - Receiving property value change notification for properties of a framework element

How to hook to the property value change notification for properties of a FrameworkElement? We are loading xaml at run time, and for each element in the visual tree, we need to hook up something to receive a property value change notification, when ever some one changes a property value of the element. What is the best way, if one exist...

How do i do this in Linq?

Hi folks, i've got an IList<Foo> and I'm trying to serialize it as Json without the field names included in the result. As such, i'm trying to create an anonymous object, which i pass to the Json serialization method. Foo is defined as (pseudo code):- public class Foo { public int X; public int Y; } When i return this as Jso...

Stop double click from happening after single click

Hi. I developing an application in WPF where a single click on an item will change the view to something else. The problem is that if the user double clicks on the item, the first event will be the single click that opens the other view and the next event will be the double click on the new view. This double click on the new view will c...

SqlParameter with Nullable value give error while ExecuteNonQuery?

I have an sql query that has a parameter that can be null in the database (Sql Server). The update method work fine until that user put a blank in the field, this produce a null value for the DataTime object (this object is nullable). The problem is when the dbCommand.ExecuteNonQuery();. Here is how I build the parameter for this field:...

XmlWriter encoding issues

I have the following code: MemoryStream ms = new MemoryStream(); XmlWriter w = XmlWriter.Create(ms); w.WriteStartDocument(true); w.WriteStartElement("data"); w.WriteElementString("child", "myvalue"); w.WriteEndElement();//data w.Close(); ms.Close(); string test = UTF8Encoding.UTF8.GetString(ms.ToA...

Instance Size in C#

Is there any way to get the size of an instance (or the class I don't mind) in C#? For example, I know in Delphi every object has a pointer to the Virtual Method Table of the class, a pointer for each interface it implements plus of course the fields of the class. According to this basic object size is 12 bytes in x86, but, is there an...