.net

Is there a memory limit for a single .NET process

We are currently thinking of building a cache-system to hold data pulled out of an SQL database and make it available to a couple of other applications (website, webservice, etc). We imagine the cache to be running as a windows service and basically consist of a smart dictionary which holds the cache entries. My question is, is there a l...

In .Net/C# is the OnSerializing event fired for XmlSerializer.Serialize

Hi, I want to set some attributes just before the object is serialized, but as it can be serialized from several locations, is there a way to do this using the OnSerializing method (or similar) for Xml serialization - my class is largely like this - but the On... methods are not being called...: [Serializable] [XmlRoot(ElementName = "R...

What tools exist for testing multithreaded .net code?

Are there any tools that can help find race conditions when testing multi-threaded .net code? I'm looking for something with similar capabilities to IBM's ConTest tool for Java. ...

How to call a VBScript file in a C# application?

I need to call a VBScript file (.vbs file extension) in my C# Windows application. How can I do this? There is an add-in to access a VBScript file in Visual Studio. But I need to access the script in code behind. How to do this? ...

How can I create a windows resource to embed in a .NET assembly, starting from text?

I was looking into embedding custom version strings using in assemblies a while back, and one approach that the documentation suggested was to embed a windows resource. The only way I can see to create a windows resource is to use the 'Native Resource Template', but the template is a binary file that isn't suitable for using with subwcr...

Embedding my .NET control in MS Project 2003

I need to extend MS Project's functionality for my company, so I would like to embed some .NET GUI controls into Project. The plan is that my controls save the user input into my custom DB tables, but I do have to bind them to tasks, current user, resources etc. Could you give me some advise how to start? I am interested in: Sample app...

How do I write a .Net Regular Expression to match from the end of line back

I have the following line of text Reference=*\G{7B35DDAC-FFE2-4435-8A15-CF5C70F23459}#1.0#0#..\..\..\bin\App Components\AcmeFormEngine.dll#ACME Form Engine and wish to grab the following as two separate capture groups: AcmeFormEngine.dll ACME Form Engine Can anyone help? ...

Memory leak in .NETCF - creating dynamic controls?

I have a problem with a memory leak in a .NET CF application. Using RPM I identified that dynamically creating controls are not garbage collected as expected. Running the same piece of code in .NET Window Forms behave differently and disposes the control as I expected. See the output from RPM via PerfMon for the Process Heap counter...

How to dynamically set which properties get bound to a DataGridView?

My DataGridView needs to support a number of types and these types may have any number of public properties, not all of which I want to display. Can anyone suggest a way to dynamically customise a DataGridView's columns when binding a class a datasource? Is there an attribute that will tell a control whether to use a property as a colum...

What's the difference between StaticResource and DynamicResource in WPF?

When using resources such as brushes, templates and styles in WPF, they can be specified either as StaticResources <Rectangle Fill="{StaticResource MyBrush}" /> or as a DynamicResource <ItemsControl ItemTemplate="{DynamicResource MyItemTemplate}" /> Most of the times (always?), only one works and the other will throw exception du...

How to invoke .net page methods from javascript without jquery ?

I've been tryin' to use call Page Methods from my own javascript code but it doesn't work. If I use JQuery AJAX Method I can sucessfully call the Page Methods, but the problem is that I need to do this from my own Javascript code because in the place where I work we can't use Third Party Javascript Lybraries and we are building our own l...

Retrieving values in reflected types from reflected properties

I need to access some members marked internal that are declared in a third party assembly. I would like to return a value from a particular internal property in a class. Then I'd like to retrieve a value from a property on that returned value. However, these properties return types that are also internal and declared in this third party...

In C#, I have a IntPtr to a WIN32 WndProc. What is the syntax for calling it?

I'm subclassing a native window (the edit control of a combobox...) oldWndProc = SetWindowLong(HandleOfCbEditControl, GWL_WNDPROC, newWndProc); In my subclassing wndproc, I'll have code like this, right, but I can't figure out the syntax for calling the oldWndProc. int MyWndProc(int Msg, int wParam, int lParam) { if (...

What's the difference between SQLNCLI and .NET Framework Data Provider for SQL Server

I have an application which uses a UDL file where the connection string specifies "Provider=SQLNCLI.1" which doesn't work on a specific machine because sqlncli.dll is not installed. Another .Net app however, where the connection string is in app.config and does not specifically show the provider does worrk. The "Change Data Source" dial...

How to decode a CSR File?

I ran accross a CSR file (Certificate Signing Request) and I need to extract some information from it. There's a way to decode it using .NET Framework? ...

What factors should effect the Data Access Layer I use on a new project?

I will be teaching a class sson, and I need to explain what factors should affect your decision of data access technology. I am familiar with many data access methods like Typed Data Sets, Linq to SQL, Linq to Entities, .netTiers, LLBLGen, and custom calls with SQL connection objects and command objects. Some of my clients will only all...

Be notified when visual/logical child added/removed

I am currently looking for a way to be notified when a child is added to the visual or logical children. I am aware of the Visual::OnVisualChildrenChanged method, but it does not apply to me since I can't always inherit and override this function. I am looking for an event. So, is there a way for the owner of a FrameworkElement/Visual...

MarshalAsAttribute Sizeconst .NET

Hi Using C#, does anyone know how to get the MarshalAsAttribute's Sizeconst value in runtime ? Eg. I would like to retrieve the value of 10. [StructLayout[LayoutKind.Sequential, Pack=1] Class StructureToMarshalFrom { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public byte[] _value1; } Thanks in advance ...

How would you notifiy clients about changed data on the server using .Net 2.0?

Imagine a WinForms client app that displays fairly complex calculated data fetched from a server app with .Net Remoting over a HTTPChannel. Since the client app might be running for a whole workday, I need a method to notify the client that new data is available so the user is able to start a reload of the data when he needs to. Currentl...

on a system with multiple monitors, how to list monitors and maximize a form into one of them?

I am working on a .NET application that displays multiple charts. My users would like an easy way to say "take chart #3 and maximize it on my fourth monitor". How can I determine the number of monitors so I can give them a selection of "monitor #1, monitor #2, etc"? (Not every user has the same number of monitors.) And once the user ...