.net

Stack vs. Heap in .NET

Hi all, In your actual programming experience, how did this knowledge of STACK and HEAP actually rescue you in real life? Any story from the trenches? Or is this concept good for filling up programming books and good for theory? ...

Mocking ResourceManager in .NET

We have a small wrapper class that uses ResourceManager to load string resources from assemblies. We also have some unit tests that check it loads the correct details from the correct assemblies for different cultures, assemblies etc. Our tests are therefore currently dependant upon resources we have constructed for the test. Is the...

Formatting Excel cell with Microsoft Interop

Hello, I generate some Excel file with Microsoft Interop, no problem, I can create files, sheet, file, password protect. But I'd like : for a specific range allow only numbers for an another specific range allow only numbers but only 0 or 1 Do you have an idea how to do this ? Thanks, ...

Microsoft PEX with NUnit

I am thinking of using Microsoft PEX tools for my project, but I would much rather use NUnit instead of MSUnit. Apparently, PEX Extensions project was specifically created for that, but it has no releases now, and appears to be dead. Has anyone been able to do this? Thanks! ...

Break string into separate lines: a showdown

Accommodating legacy database tables that were designed specifically for the IBM mainframe screens they represent has caused me much aggravation. Often, I find the need to break a string into multiple lines to fit the table column width as well as the users who are still viewing the data with terminal emulators. Here are two functions I'...

EDITED: Why does object.ToString() exist?

Isn't it much more elegant and neat to have an IStringable interface? Who needs this Type.FullName object returned to us? EDIT: everyone keep asking why do i think it's more elegant.. well, it's just like that instead of IComperable, object would had CompereTo method, that by default throwing exception or returning 0. there are objec...

Is LINQ Join operator using Nested Loop, Merge, or HashSet Joins?

Hello Does anyone know what Join algorith does LINQ performs with its Join operator. Is it NestedLoop, Merge, or HashSet? Is there any way to specify a different one, if supported? Regards Albert ...

.NET TransactionScope rollback order

Apparently (because the documentation doesn't say any word of this), in a .NET Transaction (using TransactionScope), the rollbacks are done in the same order as the commits would be, and in the same order as the registrations were done. Logically, rollback should be in reverse order: If an action sequence is "do A" then "do B", my rollb...

ASP.NET Engine for E-commerce

Hello everybody. Can you advice me good free ASP.NET engine for E-commerce? ...

Optimizing alternatives to DateTime.Now

A colleague and I are going back and forth on this issue and I'm hoping to get some outside opinions as to whether or not my proposed solution is a good idea. First, a disclaimer: I realize that the notion of "optimizing DateTime.Now" sounds crazy to some of you. I have a couple of pre-emptive defenses: I sometimes suspect that those ...

Modifying a sharepoint workflow while it's running

I've been asked to add a step to a workflow I've written but there are already many documents currently inside this workflow that I would like to switch over to the new workflow. Can this be done easily? I've looked on google and places like this: http://stackoverflow.com/questions/357032/how-to-upgrade-a-long-running-sharepoint-workfl...

Whats great deal about ASMX Services

I have been working with webservices for over 2 years now. I have lot to say about services like Soap 1.2, WSDL, the way communication is taking place and 100 of other things. I have seen people talking about their heavy ASMX background and web services expertize. But, when it comes to implementation I don't find anything but adding a w...

When does Dictionary<TKey, TValue> call TKey.Equals() for custom TKey types?

Just overriding Equals in TKey does not help. public override bool Equals(object obj) { /* ... */ } ... Equals will never be called ... ... adding this doesn't help too: public override int GetHashCode() { return base.GetHashCode(); } BUT, this helps: public override int GetHashCode() { return 0; } Now, I can look up k...

Deploying .Net dll via installshield with digital signature, IE won't run it at default security level.

Its been a long saga of deploying my .Net uploader but I'm very close. I created my .Net uploader dll in Visual-Studio, generate an installer for it with InstallShield and digitally sign it (in InstallShield). I then put that CAB file on my server and setup the html page like so: uploader.html: <html> <body> <script src="/include...

FileReader class in C#

Hello everybody. I am looking for fast class for to work with text files and comfortable reading different object (methods like NextInt32, NextDouble, NextLine, etc). Can you advice me something? Edit: BinaryReader is bad class in my case. Format of my data is not binary. I have file like 1 2 3 FirstToken NextToken 1.23 2,34 And I wa...

Is it possible to see a member variable's hard-coded value using a disassembler like Reflector?

Given the example source code below, is it possible for someone to see the value of _secret using a disassembler? I didn't see a way to get at the value via Reflector, but I haven't used it very much. Assume the code is not obfuscated in any way. class Foo { private string _secret = @"all your base are belong to us"; public v...

What is the reasoning behind a connection string in a .Net application being read-only

I have come across this problem before and I have never understood the reasoning for it: in a desktop application developed in .Net the connection string is stored as a read-only value in the application's app config. In every windows application I've written, the database needs to be set by the user: if I'm deploying an application to...

C# 3.0 Object Initialation - Is there notification that the object is being initialized?

We have several domain objects which need to support both read-only and read-write modes; they currently have a bool Locked property for this--when Locked attempts to alter properties on the object result in an InvalidOperationException. The default state for the objects is Locked. The object-initialization syntax of C# 3 introduces a ...

How to determine why an object is pinned

I am trying to track down why some objects in my application are pinned. The objects I have looked at so far are object arrays !gcroot is showing the array as being pinned but I do not know how to figure out why it is pinned. Output: 0:000> !dumpobj 0239cea0 Name: System.Object[] MethodTable: 793041d0 EEClass: 790eda54 Size: 528(0x2...

How can I play FLV files in aspx pages.

How can I play FLV files in aspx pages. Where can I find and download FLV player for ASP.NET. ...