.net

State information corrupted after dynamically adding control

In my asp .net form, I refresh a control using Ajax through the AjaxPro library. However, after doing so...causing any "normal" postback results in a yellow screen (Complete error after the message) I've set the following Page properties in web.config without any luck <pages enableSessionState="true" enableViewState="false" enableEvent...

Books For Learning C#

Hi All, I want to learn C# and the .Net Framework as well. I have no idea on the Microsoft .Net and C# framework but I once programmed on their Microsoft Visual Basic 6 with experience on making COM Components (OCX and DLL). I have an experience programming on java and have fair knowledge of Object Oriented Technology. But I am curre...

How to run regasm.exe from command line other than Visual Studio command prompt?

Hi I want to run regasm.exe from cmd. which is avalable in c:\windows\Microsoft.net\framework\2.057 I do like this c:\ regasm.exe It gives regasm is not recognized as internal or external command. So I understood that I need to set the path for regasm.exe in environment variable. For which variable do I need to set the path to run r...

Restart Windows Service when faulted

Hi We have an windows service written in .net, that is hosting WCF service. My question is, Is it possible to monitor and restart service on any fault, in other world I want my service to be restarted automaticaly on any fault.Thanks a lot ...

Making use of inbuilt namespaces in C#

Scenario: Assume I want to define my own class. public class Person { } I wish to put it in a namespace System. Note: I have not included the directive, 'using System' at the top.. namespace System { public class Person { public void Display() { Console.WriteLine("I am mine"); } } } ...

Reading 64bit Registry from a 32bit application

I have a c# unit test project that is compiled for AnyCPU. Our build server is a 64bit machine, and has a 64bit SQL Express instance installed. The test project uses code similar to the following to identify the path to the .MDF files: private string GetExpressPath() { RegistryKey sqlServerKey = Registry.LocalMachine.Op...

Error while adding a dropdown in website

I am getting the following error while i submit a form after i added a dropdown box in my designer System.NullReferenceException: Object reference not set to an instance of an object. at WebApplication1._Default.collectEmailBodyText() in C:\v1.5_production_05June09\Default.aspx.vb:line 219 Below is the extra two lines that i added in ...

where did my memory go? large private bytes count

I have a WPF app that among other things display a lot of images, large and small. My problem is that the app uses a lot of memory and I cannot figure out where it's coming from. The scenario, when stressing the app some I get this graph in perfmon: The big black line is Process\Private bytes and the other lines are the CLR mem count...

Dropdown probem

Below code i have to ammend for adding a dropdown in my asp website. I have already added could you please check what is wrong. Function collectEmailBodyText() Try Dim counterEnd As Integer = subActivated_HowManyControlsInAPanel() Dim counter As Integer = 0 Dim tempPanelLabel As Label ...

Functors when should I use them whats their intended use.

I Just can't seem to wrap my head around them. As I understand it's dynamicly adding logic to a class. Are classes within the framework prepaired for this? Why should I just extend the class and add the funtionality to it in the extention. I would be globally accessable and afaik much easier to maintain. I've Read there are 4 functor ...

What is procErr: used for in Visual Basic?

I'm currently maintaining a legacy Visual Basic project that has these "procErr:" statements all over the place. My guess is, that they are used as a way to handle if any error occurred while executing the function, is this correct? I've converted the project to VB.NET. Would a better way not be, instead of using this procErr syntax, to...

How to run execute .appref-ms C#

Hi I am trying to launch .appref-ms (Click once) application on remote machine using WMI but could not get success. The below code works fine if i try to run notpad.exe ManagementPath pm = new ManagementPath(@"\server\root\cimv2:Win32_process"); ManagementClass processClass = new ManagementClass(pm); //Get an input...

SelectedIndexChange event not firing when using through reflection

I have a windows form with a listview control. I have a selectedIndex changed event where i am performing some action. Through reflection I am trying to set the value of the list view. But the event is not getting fired. Any help will be helpfull. Edit The event looks like private void LV1_SelectedIndexChanged(object sender, Event...

.Net Add-ins and versioning

Our media center add-in is shipped as a single DLL which lives in the GAC (mediabrowser.dll), we allow users to write extensions for our add-in by referencing our DLL and accessing the pre-defined extensibility points. On load we search through a plug-in directory, load all the assemblies in the directory, search the assemblies for a t...

Are there just one "message pump", or many?

I'm new to .net and windows and are trying to figure out how to integrate legacy code into my C# project. The guy owning the code said he only needs "a message pump" and "idle processing". After some googling It sounds that at least MCF, Windows Forms and Win32 all have their own message pumps? Is this true? My C# code is a console a...

How to catch CONSTRAINT Exception when adding duplicate unique id with VB

I have a problem that adding a new ROW with duplicate UNIQUE id throws CONSTRAINTException that I cannot always catch.. Randomly general exception halts my VB software, sometimes catching works. here is my code. Private Sub BindingNavigatorAddNewItem_MouseUp() try DataGridView1.CurrentRow.Cells(0).Value = InputBox("give new ...

Find all controls in WPF Window by type

I'm looking for a way to find all controls on Window by their type, for example: find all TextBoxes, find all controls implementing specific interface etc. Thanks ...

Edit and run .NET projects from network shares

Since I run my stuff in a VM I like to save my data on shares on the host. But then running and debugging (web) applications and tests from within Visual Studio has problems. How can I configure everything to run with FullTrust when it's started in Visual Studio? Or how to just configure full trust for all network drives? I have turne...

How to call BindingNavigator1. Add button / or make hotkey for it

I use BindingNavigator1 that has ADD ROW / DELETE ROW buttons. However, I want to make my own bigger button with hotkey alt+a. How to call BindingNavigator1. AddNewItem button from my button / or make hotkey for it? There is no existing method.. ...

How does Microsoft's MEF compare to Eclipse?

What is common and different between MEF (Managed Extensibility Framework) and the Eclipse platform? I feel MEF is very similar to Eclipse with DI added. Your thoughts? ...