.net

Need a fast way to find a Type based on its FullName

I've got to allow users an easy way to identify a type in an assembly, then get the corresponding Type object. I could, hypothetically, require they give me an assembly qualified name, but its a bit klunky, and can be hard to figure out if the assembly is signed. It would be easier on my part, however, as I could use Type.GetType(strin...

Wrapping existing objects to intercept method/property calls in .NET

I have a situation where I would like to intercept calls to properties in .NET. I have been looking at DynamicProxy in Castle and it seems to work fine. But it seems in order to use it I have to start with a new object, meaning I can't do something like this: MyType myType = new MyType(); myType.Property = "Test"; ... MyType wrappedM...

Searchable Static String Storage

We have a a large set of objects that include composition and name properties, both string values that contain values with a lot of duplication, what would be a suitable data structure to store the strings which can be searchable and small? The data includes many chemical and product names that are duplicates or differ only slightly. I'...

One big webservice or lots of little ones?

I'm building a set of methods to provide functionality to a number of different web applications, the methods basically get some data from SQL perform some operations on it and then pass it back to the calling application. They have to be implemented via web services. So my question is what are the pros and cons between creating one mas...

Estimate the memory usage in .NET (VS)

Hello. I read an article about the performance of the string methods "a" + b versus string.Format("a{1}", b) and decided to make a test. There is my code in a WinForms application(VS 2005, but interested in both 2005/2008). private void button1_Click(object sender, EventArgs e) { Stopwatch stopwatch = new Stopwatch(); ...

How can I solve an application networking issue?

Hello, I have assisted with an application that has a couple of thousand deployments. This application is a .NET 2 Winforms application. There are a couple of features that require the application to "phone home" to some custom web services that we have written to update product information. For several years this has worked fin...

Looking for the Java equivalent of C#'s XmlConvert.EncodeName

The rules for defining a properly constructed XML name are defined here. C# has a utility method to convert strings into a valid XML name: XmlConvert.EncodeName. What is the Java equivalent of this utility method? Note: XML names must begin with a letter, _, or : character. After the first character, be composed only of letters, digit...

Composite WPF Problem -- View and Presenter Constructors Don't Run

Hello All, Please consider the VS 2008 .NET 3.5 SP 1 solution at this location: http://www.theese.com/SolutionName.zip This application uses Microsoft's Composite WPF (aka Prism) architecture. It is a very simple app that demonstrates a problem I'm having. I have one module with one view. That view gets mapped to the one and only regi...

Performance Counter maximum during interval?

I have an application that is executing a number of operations. I have some performance counters that measure the average time it takes to execute the operation between intervals. I would like a counter that for each interval will display the maximum time that it took to handle one of the operations since the last interval. For an ave...

Cannot export a 32-bit ServicedComponent from COM+ Catalog using Windows 7 or Windows Server 2008 64-bit

Using Windows 2003 Server or 2000, generating a COM+ application proxy for use on another system, includes .NET Enterprise Services components within the MSI package created during export. The .NET components are also registered in the GAC and regsvcs runs automatically during installation of the application proxy. However, we have dis...

Ajax-based ListView never works! (how to? help?)

... i ask this mainly because when i try to use the update panel, it does not work, i've tried placing it in itemTemplate and editTemplate and both (even tho doing this would mean having to call the whole page), however i was running out of options because when i tried to place it inside the LayoutTemplate (where it makes sense to place ...

SQL Server Compact Edition - Create Database Tables

Hi, I got it right to create a SQL Server CE database table using the code below: string connectionString = "DataSource=\"test.sdf\"; Password=\"mypassword\""; SqlCeEngine en = new SqlCeEngine(connectionString); en.CreateDatabase(); But how do I create my database tables and insert data? I've got the SQL created statements stored in t...

WCF Tracing From Code

I have all of my connections set up from my code, as opposed to using my config file. How does one go about setting up WCF Tracing on a connection built from code. I tried adding the tracing to the config file, as explained here, but it produces no logs whatsoever. I need to know either how to make it work from the config file for conne...

How to secure a 3-hop WCF facade service using certificates?

Hi, I've recently developed a WCF Facade service. I'm new to WCF and having trouble understanding the security implementation pieces. The service is as follows: An asp.net public website has a WCF client, which accesses: A WCF Facade service within a DMZ, which in turn acts as a client to access: An internal network WCF service All...

mmc snap-ins extension

Looking for how to create a snap-in extension. I know how to create STANDALONE snap-ins but, also need to look into the snap-in extensions. I'd like to create them in c#. ...

How to use Asynchronous Programming Model in ASP.NET?

I have an ASP.NET page that requires data from another DLL and the process might take a long time. So, I set out to use APM. But when I try that, the page just never stops loading. It loads indefinitely. Is there something I'm doing wrong? Here is my web page: List<string> allVoices; GetAllVoicesDelegate getVoicesDelegate; internal de...

AJAX Control Toolkit Calendar Extender v2.0.50727, script timeout

I have a repeater with 400+ AJAX calendar extenders embedded in a repeater. The appears to be too many for IE 8 to render/initilize before it times out, any suggestions on how to get this work without cutting down the number of calendar extenders? Visual Studio 2005, C#, IE 8. Thanks. ...

How do I use my Session variable in an if statement as an integer?

I have a Session that stores an int. I usually do the following... if(Session["test"] == null) Now that I am comparing... public ActionResult NumbersGame(int myNum) { if(Session["test"] != myNum)... How do I do that? ...

How to limit the number of instances of a WCF service in IIS?

My WCF service is instantiated multiple times until the system gets out of memory? How to set a single instance in IIS 7? My WCF service is already set to a single instance through attribute, but IIS seems to ignore this: [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]...

styling generic WPF controls

I am looking into creating type-safe generic controls. This is targeting the (reduced) generics support in WPF 4 and future Silverlight, and will include a hierarchy of generic controls. I have two questions: Can you use style setters and template bindings for non-generic properties defined on a generic control? In Silverlight, is the...