.net

Do you think ASP.NET MVC will compete with ASP.NET Webforms?

Do you think ASP.NET MVC will ever have a significant share of the Microsoft web development market? Or will it be more like 10-15% of the market? ...

"Error Creating Window Handle"

We're working on a very large .NET WinForms composite application - not CAB, but a similar home grown framework. We're running in a Citrix and RDP environment running on Windows Server 2003. We're starting to run into random and difficult to reproduct "Error creating window handle" error that seems to be an old fashion handle leak in...

Is there any reason to not ship the pdb's with your application?

Since you can use reflector to reverse-engineer a .Net app, is there any reason to NOT ship the pdb files with the app? If you do ship them with it, then your stack trace will include the line number with the problem, which is useful if it crashes. Please only enter 1 reason per comment for voting. ...

Asynchronous file IO in .Net

I'm building a toy database in C# to learn more about compiler, optimizer, and indexing technology. I want to maintain maximum parallelism between (at least read) requests for bringing pages into the buffer pool, but I am confused about how best to accomplish this in .NET. Here are some options and the problems I've come across with ea...

Difference between Convert.ToDecimal(string) & Decimal.Parse(string)

What is the difference in C# between Convert.ToDecimal(string) & Decimal.Parse(string)? In what scenarios would you use one over the other? What impact does it have on performance? What other factors should I be taking into consideration when choosing between the two? ...

Working with .qr2 reports in .NET?

We use an ERP that has a bunch of reports in QuickReport format (.qr2). From what I could search, Quickreports has an interface for Delphi but not for .NET. Anyone know if there's a (preferably free/OSS) solution for converting .qr2 reports to something I could work with in C#? Or a component for reading these reports directly? ...

How do you manage .NET app.config files for large applications?

Suppose a large composite application built on several foundation components packaged in their own assemblies: (database reading, protocol handlers, etc.). For some deployments, this can include over 20 assemblies. Each of these assemblies has settings or configuration information. Our team tends to like the VS settings editor (and t...

How can I ban a whole company from my web site?

For reasons I won't go into, I wish to ban an entire company from accessing my web site. Checking the remote hostname in php using gethostbyaddr() works, but this slows down the page load too much. Large organizations (eg. hp.com or microsoft.com) often have blocks of IP addresses. Is there anyway I get the full list, or am I stuck with ...

How do you get a list of all the installed fonts?

Specifically in .NET, but I'm leaving it open. ...

Best way to find out if an (upcast) instance doesn't implement a particular interface

Maybe the need to do this is a 'design smell' but thinking about another question, I was wondering what the cleanest way to implement the inverse of this: foreach(ISomethingable somethingableClass in collectionOfRelatedObjects) { somethingableClass.DoSomething(); } i.e. How to get/iterate through all the objects that don't implement...

How to Naturally Sort a DataView with something like IComparable

Hey Guys, My DataView is acting funny and it is sorting things alphabetically and I need it to sort things numerically. I have looked all across the web for this one and found many ideas on how to sort it with ICompare, but nothing really solid. So my questions are How do I implement ICompare on a DataView (Looking for code here). ...

Need Lightweight .NET SMTP implementation (assembly or source)

I am writing a small application that will receive messages to process over smtp port 25. I am looking for an .NET assembly that I can incorporate that will listen to port 25 and talk SMTP. I invision that when a message arrives some event is triggered where I can read the message and process it. Esstentilly I need to "Act" like a S...

How to make my .NET app support different languages

Hi, The application I'm writing is almost complete and I'd like people who speak different languages to use it. I'm not sure where to start, what's the difference between globalisation and culture in regards to programming? How does one take uncommon phrases such as "this application was built to do this and that" instead of File, Ope...

How do I use .Net Generics to inherit a template parameter?

I want to be able to do this. MyInterface interface = new ServiceProxyHelper<ProxyType>(); Here's the object structure MyTypeThatImplementsMyInterface : MyInterface Will this work? public class ProxyType : MyInterface {} public class ServiceProxyHelper<ProxyType> : IDisposable, MyInterface {} ...

Is there a way to compile C++ code to Microsoft's CIL "bytecode"?

i.e., a web browser client would be written in C++ !!! ...

Loading .Net Fx query...

I have built a simple C#.Net app on a M/C with only .Net FX 1.1 present. Now when I execute this app on a M/C where there is : Case 1) Only .Net fx 2.0 is installed Case 2) Both .Net Fx 1.1 amd 2.0 are installed How is it determined to load the appropriate .Net framework in the above cases. ...

What is your session management strategy for NHibernate in desktop applications?

I find it much more difficult to manage your session in a desktop application, because you cannot take advantage of such a clear bondary like HttpContext. So how do you manage your session lifetime to take advantage of lazy loading but without having one session open for the entire application? ...

Double and floats in C#

Are you aware what precision of operations on floating point numbers is different in project compiled in debug mode vs the one compiled in release mode. ...

Querying Active Directory with "SQL"?

I just wonder if anyone knows or made a wrapper around Active Directory to be able to easily query it in .net? Kind of like "LINQ-to-ActiveDirectory" or some SQL Dialect, i.e. to be able to do "SELECT DISTINCT(DEPARTMENT) FROM /Users/SomeOU/AnotherOU" or "SELECT user FROM domain" or whatever. As far as I know, it is possible to query WM...

How can I detect the encoding/codepage of a text file

In our application, we receive text files (.txt, .csv, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the files where created in a different/unknown codepage. Is there a way to (automatically) detect the codepage of a text file? (I use .Net / C#). The detectEncodingFromByteOrderMarks, on the ...