.net

DotNetOpenAuth submit multipart/form-data

Is anyone aware of any samples available for uploading a file using oAuth with DotNetOpenAuth and submitting via a multipart/form-data? ...

Where is the castle dynamicproxy repo?

I can't seem to find the repo for castle dynamic proxy? I found the code on http://sourceforge.net/projects/castleproject/ I need to fix it so it works in medium trust. It seems the caste.core assembly needs the allowpartically... attribute in the assembly.cs file. ...

Detecting Process Creation

I need to detect process creation of a third-party .NET application. My goal is to inject a plugin DLL to enhance functionality of this application. I would prefer to inject this as early as possible so I can catch the application's initialization events. Is there any way to detect when this process is created and inject the DLL before M...

Maintaining xml hierarchy (ie parent-child) information in objects generated by XmlSerializer

Hello all, for some time now I have been trying to solve the following problem and I'm starting to run out of ideas: I have generated a set of C# classes from an xsd schema using the xsd.exe tool and deserializing xml files works fine. The problem is that apart from the convenience and safety of using the auto generated classes, I also...

How to Iterate Through Array in C# Across Multiple Calls

Hi Guys, We have an application where we need to de-serialize some data from one stream into multiple objects. The Data array represents a number of messages of variable length packed together. There are no message delimiting codes in the stream. We want to do something like: void Decode(byte[] Data) { Object0.ExtractMe...

How to call a .NET dll from a win32 process?

What are the options when it comes to using a .NET dll from a win32 process? I need to basically use a C# dll from a Win32 process. I have a possible solution right now that requires adding the C# dll to the GAC (using RegAsm.exe), then calling the C# dll via COM wrapped calls. However that solution is pretty heavy. It requires that t...

Converting Linq to XML query from C# to VB.Net. Can you spot my error?

I'm converting the Linq query below from C# to VB.Net. Can you spot my error? The query joins 3 XML datasets. Thanks in advance! C# - This one works great. List<Course> courses = (from course in CourseXML.Descendants(ns + "row") join coursecategory in CourseCategoryXML.Descendants("Table") on (string)course.Attribute("code") equals...

Team Foundation Build - resolving cross solution project references

We have a shared project referenced across multiple solutions which, when encountered by TF build causes: 'error MSB3202: The project file "......\trunk\\\sharedproject.csproj" was not found'. This is fine as the directory structure on the build server does not reflect that of source control. Is it possible to modify the build file...

Quick and dirty reflection based XML Serializer

Does anyone know of a quick and dirty implementation of a reflection based XML serializer? I am looking to rip out my XML serialization code due to the horrid start up time. I know about sgen.exe but do not want to complicate my build and packaging process. We use the XML serialization at startup to pull out configuration values from...

Mocking a Static Class

I have a static class that wraps some native methods from winspool: public static class WinSpool { [DllImport("winspool.drv")] public static extern int OpenPrinter(string pPrinterName, out IntPtr phPrinter, IntPtr pDefault); ... //some more methods here } I would like to mock them for unit testing, but couldn't fin...

How to call a C# dll in ruby?

How to call a C# dll in ruby? ...

Generate Image with Microsoft .NET Chart Controls Library without Control

Is it possible to generate images (jpeg, png, etc) using the Microsoft Chart Controls library without instantiating a WinForm or ASP.NET Control class? All the examples I have seen utilize a control component. I need to create a library which contains simple methods that take data to be plotted and returns a new chart image. Examples:...

Tabcontrol: How can you remove the tabpage title?

I have a tabcontrol used to display multiple image files in an application. I would like to remove the tabpage title when there is only one tabpage displayed, so I can use that screen space for the image. (This is similar to deselecting "Always show the tab bar" in Firefox.) Is this possible to do with the tabcontrol? Or am I better off...

Pulling Images from RSS Feed

I am developing a background wallpaper changer for Windows. I am looking into pulling images from RSS feeds. As how they are displayed from feed to feed changes, I am currently pulling the page as text and searching for text such as "<img src="... and others. Obviously this is not a viable option, how else could I complete this? ...

Abstracting from Stateful object navigation (1-1) - the challenge

Hi, The point of this exercise is to make navigation between objects stateful. For example, having Person and Address with 1-1 association it should: If an address is assigned to a persons, then the person should be assigned to the address (and vice versa). If address is assigned to person1 and then to person2, then the person1 wil...

How to serialize a derived class as its base class

I have a derived class that adds only methods to a base class. How can serialize the derived class so that it matches the serialization of the base class? i.e. The serialized xml of the derived class should look like: <BaseClass> ... </BaseClass> e.g. The following will throw an InvalidOperationException "The type DerivedClass was n...

POCO objects with lazy loading

Hi! I'am new to ASP.NET MVC, IoC, POCO, etc. So I want to know is it OK to use such kind of architecture. This is my demo project. Project.Core (this assembly referenced by all project) public class User { public string Name {get; set;} public List<UserGroup> UserGroups{get; set} } public class UserGroup { public string Tit...

asp.net regular expression validator client side script error

I have the following regular expression validator to detect whether an input string contains HTML/script tags and if so cause a vaidation error: <asp:TextBox ID="txt" runat="server" /> <asp:RegularExpressionValidator ControlToValidate="txt" runat="server" ID="regexVal" EnableClientScript="true" Dis...

partial argument match in rhino mocks

Hi, In my unit test instead of IgnoreArguments i want to use some partial matching of arguments in rhino mocks testing. How to do that? Thanks, John ...

MsmqMessage<T> neccessary ?

I am analyzing a BizTalk application (aka orchestration) that is communicating with a WCF service by MSMQ. I was wondering why one of the WCF service implementations has a MsmqMessage as a parameter in the service method. I was expecting a contract type T instead of a MsmqMessage. This is not really binding agnostic, because the WCF ser...