.net

c# .NET: Show a command prompt message(or, message at console) from windows application

Hi All, I m working on a windows application, and i want to show some status messages at command prompt while executing the windows application, how can i do that cmd.exe can be run through windows code.but i don know how to show some message at command prompt or if there is any way to do somthing like Console.WriteLine("Message") throu...

Differences between x86/x64/ia64 memory models on .NET

I'm looking for a reference on the differences between the memory models used by the .NET CLR/JIT on x86/x64/ia64. I know there's some differences between x86 and ia64 (instruction reordering, instruction removal, etc.), but I haven't found a reference on the differences between x86 and x64. I have an application that is aiming for s...

Sharing constants across a WCF service

I have certain strings which contain special characters so they can not be shared as enum members across a WCF service. (Actually, they are keys for configuration values.) I want to be able to pass in the keys at client side and get back the config values. If there is a change, I only want to change the config keys at one place. Consta...

ComboBox: selected value stays in focus (blue)

Hello all, I have made a small example program to illustrate my problem. The program consist of one form with one TableLayoutPanel: tableLayoutPanel1 one NumericUpDown: coins and one Button: flip. When flip is pressed the tableLayoutPanel1 is dynamically filled with coins.Value rows. Each row consist of one ComboBox with the items "Heads...

DataGridView repeatedly recreating columns

I have a problem when assigning the DataSource propery on a DataGridView control. My DataSource is a DataTable's DefaultView and, as expected, columns are automatically created in the DataGridView to match those in the DataTable when I assign it. What happens next is that the columns seem to be automatically removed and recreated a furt...

What are finalisers for?

I have been programming in .NET for four years (mostly C#) and I use IDiposable extensively, but I am yet to find a need for a finaliser. What are finalisers for? ...

Generic Array of Enum Values?

Hey all, I'm currently writing a helper function in VB.NET to convert an array of enum values to a CSV, but I'm encounting a few difficulties.... I'm not sure what type of arguement my function should take if I want to make it generic enough to handle any enum I pass into it. This is what I've got so far: Public Shared Function EnumA...

C#: How to get the number of items in a combobox

Hello, How can i get the number of items listed in a combobox? ...

Asynchronous WebRequest with POST-parameters in .NET Compact Framework

Hey all. I'm trying to do an asynchronous HTTP(S) POST on .NET Compact Framework and I can't seem to get it working. Here's what I'm doing: private void sendRequest(string url, string method, string postdata) { WebRequest rqst = HttpWebRequest.Create(url); CredentialCache creds = new CredentialCache(); creds.Add(new Uri(ur...

Creating a typefrom Xml

Hi, i have a xml like this I want to parse the xml, build a dynamic class with spscified properties. i found some pointers to do it with system.reflection.emit namespace, but i do i always have to create an assembly and module in order to define the type? can i just create a type and define the properties? <Root> <type> <name>mytype<...

Using VirtualPathProvider for simple static files

We are using custom VirtualPathProvider to serve files from ASP.NET-based web site. To serve static files, like images, css and scripts, we explicitly stated that StaticFileHandler should be used for files with this extension. Like this: <add verb="GET" path="*.jpg" type="System.Web.StaticFileHandler"></add> All of this seems logical ...

.NET: with respect to AssemblyVersion, what defines binary compatibility?

What changes to a strong-named assembly necessitate a change in AssemblyVersionAttribute? Clearly, changing the public api in a way that could require a client to have to make a code change requires an increase in AssemblyVersion. But what about changes to the public API that don't require code changes in the client? For instance: the ...

Correct use of Object Properties

Below is a Class I created to track the current Person in my glorified Data Entry and retrieval app. Once they select a person it calls the constrtuctor which then calls the database to fill in all the rest of the info. Also, throughout the program they will be able to change the various fields. With this in mind do I have the below...

Could not load file or assembly 'log4net

Ok I am having a very odd issue when deploying one of our web applications to our live servers. Our application uses log4net to log a lot of actions quite heavily and after a couple of hours after being deployed we get the following exception. Could not load file or assembly 'log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b3...

To "new" or not to "new"

Is there a rule of thumb to follow when to use the new keyword and when not to when declaring objects? List<MyCustomClass> listCustClass = GetList(); OR List<MyCustomClass> listCustClass = new List<MyCustomClass>(); listCustClass = GetList(); ...

Rollback database after integration (Selenium) tests

Does anyone have any suggestions for a best practice or preferred way of rolling back database transactions made from an integration test framework such as Selenium? Here is our current situation: We have a .net web project with a number of unit tests which work fine in our unit test environment - each test inherits a parent class whic...

Two DataGridViews; lining up columns

The project on which I'm currently working has two datagridviews that are meant to compare two versions of similar data (same number and name of columns). I'd like to resize all the columns so that they fit two criteria: 1) Autosize to fit data (that's easy) 2) So the columns are lined up such that for any column COL, gridA[COL].Width ...

Is there a better, 3rd party "Find" / "Search" add-on for Visual Studio 2008?

I can't stand Visual Studio 2008's "Find" or "Find and replace" functionality, does anyone know of a better 3rd party solution that integrates into visual studio? At this point, I'd gladly take any "Find" utility, visual studio integration or not. Some of the things VS.net 08 wont do that I'd like to do: let you specify the file type...

Starting "Click-Once" published application keeps trying to install .NET Framework

The following dialog window keeps popping on my computrer when starting "Click-Once" published application from Internet URL: [Microsoft .NET Framework Setup] - Would you like to download and install the Microsoft .NET Framework? The content you are trying to access requires the Microsoft .NET Framework. Would you like to ...

Why do custom membership provider files have to be in the app_code folder of my web app?

I'm writing a custom memberhsip provider based on the source for the SQL provider and I tried first making the SQL Provider a separate project. Yet, the web app wouldn't recognize it unless I put all the source in an APP_Code folder in my web app. Is this how you implement a custom provider? I thought I could simply reference the provid...