.net

New web app project does not recognize the <asp: tag space

Visual Studio 2008 w/Sp1 To reproduce my problem I simply create a new .Net 2.0 web application and add a page with the following markup: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication5._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...

Can I position .net's (Forms) Message box or Common dialogs?

I am trying to get center of parent form, not center of screen behavior. Passing in the parent form seems to only control the ownership of the window. These classes are sealed, so I do not see how I can do any WinProc tricks. Rewriting the classes is not an appealing option. Any other ideas? ...

Is there any way to trick the .net JIT compiler into running another method?

Ok, say that my application is emitting (x86) instructions into memory, making the page executable, etc. Is there any way of altering the method stub of an un-JITted method to point to my emitted instruction stream? E.g.: Suppose I have created an x86 instruction stream in memory, which does something arbitrary. Now, further suppose th...

Problem sorting lists using delegates

I am trying to sort a list using delegates but I am getting a signature match error. The compiler says I cannot convert from an 'anonymous method' List<MyType> myList = GetMyList(); myList.Sort( delegate (MyType t1, MyType t2) { return (t1.ID < t2.ID); } ); What am I missing? Here are some references I found and they do it the same ...

Implementing wait for condition or cancel with threading

I am trying to implement the following functionality: class WeightResolver { WeightMonitor _source; bool _cancelled; Weight _threshold; public Cancel() { _cancelled = true; } public Weight Resolve(){ _cancelled = false; while(_source.CurrentWeight < threshold ) { if(_cancelled) throw ...

Mixed Mode Library and CRT Dependencies - HELP

Alright, after doing a ton of research and trying almost every managed CPP Redist I can find as well as trying to copy my DLLs locally to the executing directory of the app I cannot figure out what dependencies i'm missing for this mixed mode library. Basically I have a large C# application and I'm trying to use a mixed mode library I m...

Difference between lock(locker) and lock(variable_which_I_am_using)

I'm using C# & .NEt 3.5. What is the difference between the OptionA and OptionB ? class MyClass { private object m_Locker = new object(); private Dicionary<string, object> m_Hash = new Dictionary<string, object>(); public void OptionA() { lock(m_Locker){ // Do something with the dictionary } ...

What resolution .ico files do XP and Vista show on the desktop?

There's loads of choices for .ico files but I can't see any logic in how Windows chooses which resolution/bit depth to show ...

Membership and Role Providers in ASP.NET 2.0 with non SQL Server provider?

I have quickly read (and will read with more care soon) the article of Scott Allen concerning the possibility to use an other provider of the default SQL Express or SQL Server database to use the "Membership and Role Providers" for ASP.NET. We will soon need to open a part of our project to some client via the web and I thought about us...

retrieve xml doc comments programmatically

Visual Studio does it; Reflector does it; and now I want to as well :) I want to retrieve the xml documentation for some members in some framework assemblies (i.e. mscorlib.dll, System.dll, etc). I assume this would involve: finding the xml file for the assembly, navigating to the appropriately named child element, and retrieving th...

What would be the most convenient way to connect Visual Studio 2005 (C#) to Oracle8?

I'm looking for best practices for establishing connections between Oracle 8 and Visual Studio 2005 applications. The target would be a Windows Forms application written in C# that hits the database once a second to monitor tables looking for their last inserted record. I'm considering using "Application settings" to store the connection...

Use "greater than or equals" or just "greater than"

I remember from C days that we were encouraged to use i > -1 instead of i >= 0 because of performance. Does this still apply in the C# .NET world? What are the performance implications of using one over the other with today's compilers? i.e. Is the compiler clever enough to optimize these for you? (As an aside try and type the qu...

Where is the MOQ documentation?

Where can I find comprehensive documentation for MOQ? I'm just starting with mocking and am having difficulty getting my head around it. I've read through all the links at http://code.google.com/p/moq/wiki/QuickStart but can't seem to find a tutorial or gentle introduction. I have also looked briefly at Rhino Mocks but found it very con...

Autostart Smart Client application

Have a standard smart client application that we want to autostart when a user logs into their machine on our network. I've tried the following keys: HKLM\Software\Microsoft\Windows\CurrentVersion\Run HKCU\Software\Micrisoft\Windows\CurrentVersion\Run HKCU\Software\Micrisoft\Windows\CurrentVersion\Policy\Explorer\Run etc.... The star...

How to reference current object in xaml

I cant' figure out how to reference the current instance object defined by the xaml file in the xaml file. I have a converter that I want to send in the current instance as the parameter object. {Binding Path=<bindingObject>, Converter={x:Static namespace:Converter.Instance}, ConverterParameter=this} In this code this is converted to...

Why this code is not working ?

Hi guys I wrote this code and i have two errors. Invalid rank specifier: expected ',' or ']' Cannot apply indexing with [] to an expression of type 'int' Can you help please? static void Main(string[] args) { ArrayList numbers = new ArrayList(); foreach (int number in new int[12] {10,9,8,7,6,5,4,3,2,1}) //...

Wiki Platform for .NET

Looking for a good choice of .NET-based Wiki Platform. Doesn't need to be Open Source, but the cheaper the better. ...

How do I find where my .Net app is leaking Windows handles?

Hi all, I've got a WinForms .Net app that runs over a lot of XPS documents (thousands) and during this run the number of handles (according sysinternals process monitor and task manager) increases by between 3-10 for each document. I heavily suspect that these are handles that are opened and not closed by the MS .Net XPS framework libra...

.NET compact framework and ActiveSync

Is there a way that my .NET CF app running on a Windows CE device can know when the device is docked/synced with the PC? ...

Confused about BackgroundWorker events not firing

This may seem like a somewhat contrived example, but I'm left scratching my head. Ok, I have a console app that instantiates a WindowsForm and calls a method called DoSomeWork() on the form. class Program { static void Main(string[] args) { Form1 form = new Form1(); form.DoSomeWork(); } } Form...