.net

Best C# Profiler?

Recently I used RedGate ANTS profiler which seems pretty good, but the application I tried to profile was crashing due to DivideByException, where as running in inside Visual Studio was fine for both debug and release. Are there other/better C# profilers that you know of? ...

Implementing friend (available in C++) functionality in C#

Ok, let's leave the debate of whether friendship breaks encapsulation, and actually try elegantly come up with a coherent design. It is a two fold function: 1) General question on how to implement: public class A { friend class B; } 2) Why do I need this functionality? Some of my classes implement ISerializable inter...

How to draw a table with C#?

I need to draw a table of data into a vector image with C#. I'm looking a library or component that helps me to draw the table without having to care about its layout myself. All I'd like to care about is what data belongs into which cell. I already know of some libraries that allow me to create vector images with C# (e.g. SharpVector...

System.Drawing.Font: no concept of font weight?

I just noticed that in .net that System.Drawing.Font seems to have no concept of font weight other than FontStyle of normal and bold. I don't have the fine control I had in win32. The WPF framework has font weights, but I'm not using that namespace. ...

Practical usage of partial keyword in C#

I know it lets visual studio to separate WinForms UI code from the UI events, etc. But are there any practical uses for it? ...

What makes The ADO.NET Entity Framework different than other ORM in the market?

The question header is clear, i want to know why its different and why, when to select it for my project? ...

WCF: How do I get the list of endpoints from ServiceHost?

I can add endpoints using ServiceHost.AddServiceEndpoint. How do I get that list of endpoints back out? ...

BindingSource's and DataGridView's

Hey Stackers, I have two DataGridView's bound to an underlying DataSource through BindingSources and TableAdapaters. I have two models; strings and tables. Tables -> [id, handle, description] Strings -> [id, handle, table_id] So there's a many-to-one between Tables and Strings. What's the easiest way to make the selection of the "t...

Do you know of any OpenSSH libraries for Windows?

I'd like to incorporate OpenSSH support into a Windows application and I am looking for a library (preferably .Net or something easily integrated into .Net) that can provide this functionality. I'm more interested in ssh client software than server software, but both functions would be even better. Edit: I'd prefer a free and open so...

Why can't I put a delegate in an interface?

Why can't I add a delegate to my interface? ...

Determine number of elements of each type in a heterogeneous containercontainer

Hello, I use Dictionary as a heterogeneous container: Dictionary<string, Object> _Table; It basically maps some description to int/double/string/ISerialiazable/etc types. I want to efficiently calculate number of elements of each type, and then only print the elements of that type -- in SQL, I would group by type, then print coun...

Error with server install of new MVC app and MVC Release Candidate 2

I have developed a small application using MVC RC2. The application works fine in my development environment, but fails when I push it to my production environment with the following error: Method not found: 'Void System.Web.Mvc.RouteCollectionExtensions.IgnoreRoute (System.Web.Routing.RouteCollection, System.String)'. App pool is r...

What can cause properties in an .NET Service Reference to become null on invocation?

I just had a laptop crash (spilled water on it). I copied my working code (2 days ago backup) from a Windows Server 2008 laptop to a Vista laptop running Visual Studio 2008 SP1. Both are running .NET 3.5 SP1. I have a web method call which is returning product information. Some of the fields in the web service (running on a hosted serv...

TableAdapter occasionally returning row count 1 but all null columns

I'll hit refresh on my page 20 times and it will work, then a few minutes later it stops working for 5min. The tableadapter says that it has a count of 1 but when i access a property eg : tableadapter1[0].property1 it throws an exception: [StrongTypingException: The value for column 'blogpull_keywords' in table 'blogpull' is DBNull.] b...

XslTransform vs XslCompiledTransform

XslTransform appears to have been deprecated by Microsoft in favor of XslCompiledTransform. Theoretically, if I was doing just one transform during the execution of my application, shouldn't interpreting the XSLT (through XslTransform) be faster than compiling it? If so, is XslTransform written so badly that the improvements made to X...

Possible to Create ToolStripMenuItem With Both TextBox and Label?

In a WinForms .Net 2.0 application, I want to create a context menu with a ToolStripMenuItem that has both a label AND a textbox in the item itself. An example of what I am talking about can be found in Access - when viewing an Access table, the context menu has options for "Filter By Selection", "Filter Excluding Selection", and then "F...

Why are strings copied in .NET?

Since strings are immutable in .NET, why are they copied for simple operations such as Substring or Split? For example, by keeping a char[] value, int start and int length, a substring could be created to simply point to an existing string, and we could save the overhead of copying the string for many simple operations. So I wonder, why ...

Binding to an auto-updating object?

Is there an object or interface I can use to make an auto-updating object, and have those updates filter through to the UI in WPF? Basically I'm looking for something like this: <TextBlock Text="{Binding Source={StaticResource myClass}, Path=DataObject}" /> public class MyClass { public AutoUpdatingObject DataObject { get; set; } ...

How to read a value from a barcode reader?

How to read a value from a barcode reader using c#. ...

.net client profile horror

I read everywhere that the .net client Profile is helping spread .net 3.5 but up to my (now quite big) experience it is not: 1-On many computer it takes up to 1 hour to install , most however takes 30 min 2-the installer is not friendly at all : fast until 11%, blocking for 10 min, then resuming faster, then slowing again with no infor...