.net

How do I set up a test cert for an SSL connection in .NET?

I would like to create an SSL connection for generic TCP communication. I think I figured out how to do it in the code, using the info here: http://msdn.microsoft.com/en-us/library/system.net.security.sslstream.aspx What I'm having trouble with is creating a cert so I can test this out. I tried makecert.exe testCert, and that created a...

Silverlight vs Flex

My company develops several types of applications. A lot of our business comes from doing multimedia-type apps, typically done in Flash. However, now that side of the house is starting to migrate towards doing Flex development. Most of our other development is done using .NET. I'm trying to make a push towards doing Silverlight devel...

Is there a way to get a System.Configuration.Configuration instance based on arbitrary xml?

I'm trying to unit test a custom ConfigurationSection I've written, and I'd like to load some arbitrary configuration XML into a System.Configuration.Configuration for each test (rather than put the test configuration xml in the Tests.dll.config file. That is, I'd like to do something like this: Configuration testConfig = new Configura...

Determine Loaded Assemblies

How can I determine all of the assemblies that my .NET desktop application has loaded? I'd like to put them in the about box so I can query customers over the phone to determine what version of XYZ they have on their PC. It would be nice to see both managed and unmanaged assemblies. I realize the list will get long but I plan to slap ...

What's the best string concatenation method using C#?

What's the most efficient way to concatenate strings? ...

How do I use Linq for paging a generic collection?

I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I query only any single page of MyCustomClass objects? ...

How do I page a generic collection without Linq?

I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how can I collect only any single page of MyCustomClass objects? This is what I've got. How can I improve it? 'my given collection and paging parameters Dim AllOfMyCustomClassObjects As System.Collections.Generic...

Which .NET Dependency Injection frameworks are worth looking into?

Which C#/.NET Dependency Injection frameworks are worth looking into? And what can you say about their complexity and speed. ...

Is it possible to share a transaction between a .Net application and a COM+ object?

I did some tests a while ago and never figured out how to make this work. The ingredients: COM+ transactional object (developed in VB6) .Net web application (with transaction) in IIS that... makes a call to the COM+ component updates a row in a SQL database Testing: Run the .Net application and force an exception. Result: The...

.NET - Get protocol, host, and port

Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL: http://www.mywebsite.com:80/pages/page1.aspx I need to return: http://www.mywebsite.com:80 I know I can use Request.Url.AbsoluteUri to get the complete URL, and I know I can use Request.Url.Authority to get the...

List<BusinessObject> or BusinessObjectCollection?

Prior to C# generics, everyone would code collections for their business objects by creating a collection base that implemented IEnumerable IE: public class CollectionBase : IEnumerable and then would derive their Business Object collections from that. public class BusinessObjectCollection : CollectionBase Now with the generic lis...

Open source rules engine with decent interface for writing rules

I'm trying to locate an open source business rules engine that has a decent interface for building the rules. OR at least one that works well on the .Net platform and has been updated sometime in the past 12 months. Thanks, ...

Programmatically encrypting a config-file in .NET

Could somebody please do a rundown of how to programmatically encrypt a config-file in .NET, preferably in C#. What I would like to do is do some kind of check on an application's startup to see if a section is unprotected, and if it is, then encrypt it. This for both settings and connection-strings. Also if anyone could list the types...

WPF Anti aliasing workaround

Anti aliasing cannot be turned off in WPF. But I want to remove the blurred look of WPF fonts when they are small. One possibility would be to use a .net 2.0 component. This looks like it would lose the transparency capability and Blend support. Never tried it though. Anyone has a solution for this? Any drawbacks from it? Thank you ...

Loading assemblies and its dependencies

My application dynamically loads assemblies at runtime from specific subfolders. These assemblies are compiled with dependencies to other assemblies. The runtime trys to load these from the application directory. But I want to put them into the modules directory. Is there a way to tell the runtime that the dlls are in a seperate subfold...

Send out email at a user's local time.

I am writing a program that needs to send out an email every hour on the hour, but at a time local to the user. Say I have 2 users in different time zones. John is in New York and Fred is in Los Angeles. The server is in Chicago. If I want to send an email at 6 PM local to each user, I'd have to send the email to John at 7 PM Server tim...

Remoting server auto-discovery. Broadcast or not?

I have a client/server application that communicates with .Net remoting. I need my clients to be able to find the server(s) on the network without requiring client-side configuration. As far as I know, there is no support for discovery in remoting. I am prepared to implement a UDP solution where the clients will be able to find the ser...

How to late bind 32bit/64 bit libs at runtime

I've got a problem similar to,but subtly different from, that described here (Loading assemblies and their dependencies). I have a C++ DLL for 3D rendering that is what we sell to customers. For .NET users we will have a CLR wrapper around it. The C++ DLL can be built in both 32 and 64bit versions, but I think this means we need to have...

WCF push to client through firewall?

See also How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g. Coment or long polling) I need to use push-technology with WCF through client firewalls. This must be a common problem, and I know for a fact it works in theory (see links below), but I have failed to get it working, an...

.NET - Throwing Exceptions best practices

What are the best practices to consider when catching exceptions, and re-throwing them. I want to make sure that the Exception object's InnerException and stack trace are preserved. Is there a difference between the following code blocks in how they handle this? try { //some code } catch (Exception ex) { throw ex; } //...... t...