.net

Serialization exception in .NET: System.InvalidOperationException: You must implement a default accessor on System.Collections.Generic.Stack`1

All I am trying to do is XmlSerializer serializer = new XmlSerializer(typeof(Stack<int>)); and I get the following at runtime: System.InvalidOperationException: You must implement a default accessor on System.Collections.Generic.Stack`1 [[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] b...

App.config of class DLL has info I need in web app

I have a class library that I have built that includes several service references. In order to move the project forward I've copied the <system.serviceModel> config section from the app.config into the web.config. It works fine for now because I only have two references that I am tapping into at the moment. The problem I will be running ...

Can an open source databases like MySQL support my web site's load?

I'm about to start developing a product (in .NET), and I'm evaluating open source database engines in order to avoid adding licensing costs to the overall cost of my product. Which ones do you know that are potent? Is MySQL a good alternative? What kind of website load can it support? Do you have any experience using an open source dat...

Factory Pattern Advice Needed Please

I'm working on wrapping my head around the factory pattern by using it in a simple data storage project in my free time. The idea is to take simple data and save it to a database using a simple factory pattern in VB.NET. I think I have a basic understanding of the pattern itself, however, what I'm struggling with is how to fit the fact...

Memory Management in WinCE C#

How can i manage program memory in C# code ? (in WinCE) ...

How do I implement this type of OOP structure?

Hi, I want to build a nice API (C#) to make it easier for people to consume, I think I've seen this before and want to know how to do this: MyNamespace.Cars car = null; if(someTestCondition) car = new Honda(); else car = new Toyota(); car.Drive(40); Is this possible? If so, what needs to be done? ...

Is there a port of the Rhino JavaScript engine for .NET

I worked for a company that had both Java and .NET implementations of an application. The app allowed for end-user customization of processing and business rules using scripts. The Java version supported JavaScript using the Rhino engine. The .NET app required VBScript. I would like to do something similar using .NET, but I would prefer ...

How can I test my knowledge of .NET?

A lot of programming and computer science topics are tricky, and as a result it's hard to know sometimes if you've gotten an idea straight after just reading about it. Some programmers' learning material incorporates self-testing pretty well; a great example of this is The Little Book of Semaphores. I'd love some ways to test my knowle...

Instantiating objects with a Configuration class or with Parameters

I am running into a design disagreement with a co-worker and would like people's opinion on object constructor design. In brief, which object construction method would you prefer and why? public class myClass { Application m_App; public myClass(ApplicationObject app) { m_App = app; ...

Checking for the existence of an object in a collection (of T)

I see that over on this question http://stackoverflow.com/questions/312024/linqy-way-to-check-if-any-objects-in-a-collection-have-the-same-property-value there is a request to say how to do something using LINQ to see if a property matches in a collection. However, is this the fastest reasonable process by which to do this? I will be dep...

Extending a C++ application with C# plugins

I have a C++ Windows application that can be extended by writing C++ plugins, using an API that is exposed by the application. There is also one plugin that translates the C++ API to Python (e.g. plugins can be written in Python). I want to allow users to write plugins in C# in addition to C++ and Python. Since I'm not very familiar wit...

What is the difference between List (of T) and Collection(of T)?

I've seen them used in a lot of the same ways, and I am worried I'm about to go down a path in design that is irreversible if I don't understand this better. Also, I am using .NET. ...

How is null represented in .NET

I was having a conversation with a co-worker and the subject of null came up. He was telling me that in .NET behind the scenes it is just a really small number. I always thought that the object just didn't have a pointer to any memory on the heap but i wasn't sure either way. So i'm hoping the community can clear it up for us ;P ...

How to flush all caches in process for EntLib Caching

I'd like to know if there is a way to tell the Enterprise Library Caching objects to flush all configured caches for that process to flush. Even enumerating through all of the configured caches for that process, and manually flushing each one, is ok, but is there an API method from EntLib.Caching that will give me those values? Or do I...

Product Installation and Configuration on a Windows Machine

Hi, I am working on a .NET 3.5 project which consists of a web application and a Windows service. Both need to be deployed on the server machine. I have created an msi package using Wix 3 which installs the application files, creates shortcuts and registers the service. My next task is to implement the following: Post-install step t...

I still don't get Delegates

Hi, Isn't the use of delegates to help with some asynchronous cases? I tried the following but my UI still hangs. When on earth do you use delegates? Public Class Form1 Private Delegate Sub testDelegate() Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles Button1.Click ...

Why doesn't a Dictionary access nonexistent keys like a Hashtable does?

If I'm using a Hashtable, I can write code like this: object item = hashtable[key] ?? default_value; That works whether or not key appears in the Hashtable. I can't do that with a Dictionary<TKey. TValue>. If the key's not present in the dictionary, that will throw a KeyNotFoundException. So I have to write code like this: MyClass...

MTU for WebServices

We have an ERP application which has all clients connect using WebService. My network engineer tells me that the MTU of the webservice is too small and we would like to increase it to improve performance. As far as I can tell there is no config section for MTU for dotnet web services. Any ideas on where we could configure this? ...

Update without first selecting data in LINQ 2 SQL?

How can you go about updating a record without having to select the data first in LINQ? As you must first perform a linq select (obviously calls a SQL SELECT which is costly), change required properties, then perform SubmitChanges(). I wish to avoid this and just perform a SQL UPDATE, I already know the ID. ...

How can I grab a double key stroke in .NET

How can I grab something like ^MM (CTRL + M + M) in .NET, using C#? ...