.net

2 WCF services, 1 common interface, multiple headaches.

I have 2 WCF services that implement an interface from a separate library. The interface's methods are not marked with either the WebGet or the WebInvoke attribute. BUT, one service is going to be handling POST request, while the other is handling the GET request. So its kinda like this: Service 1: Handles all POST request. Request ...

Assembly creation guidelines

Is there any rule of the thumb as to the number of static functions you can have in an assembly? How do you recognize if a function needs to be static v/s a function that doesn't need to be static? ...

Why does my custom HttpResponse throw exception on HttpResponse.End()?

I'm writing some code in which I need to use my own HttpResponse object to capture the output from a method on another object that takes an HttpResponse as a parameter. The problem is, this other object (which I cannot modify) calls HttpResponse.End(), which causes an "Object reference not set to an instance of an object" exception to b...

MSBuild 3.5 produces different IL than MSBuild 4 for the same code

Edited to indicate the VS'08 cannot compile a working dll, though I original said it could We have a piece of VB code that compiles differently depending on what tools are used to compile it. I have tried compiling this code on several different computers using Visual Studio '08, '10, and MSBuild 3.5 and 4. MSBuild 3.5 (which our bu...

.net mvc2 - change view location from controller

I have 2 urls /Data and /Data/{month}/{day}/{year}. I've created two routes routes.MapRoute( "Data_Name", "Data", new { controller = "Data", action = "DataForAnyDate" } ); routes.MapRoute( "DataFullDate", "Data/{mon...

Better solution for WCF service(s) that talk to 3rd party Java services?

I am in a scenario where I have to integrate with a 3rd party system here at my job that exposes Java-based web services. I can parse the service WSDL definitions and generate proxy classes and interact with them just fine in the .NET world. However, the services aren't very "clean" in the sense that the property names in the Java app's ...

How can I use Castle's RemotingFacility to access two different endpoints from the client?

I have a web application that communicates with multiple .net remoting endpoints. I'd like to use the Castle RemotingFacility to resolve my remote dependencies, but it looks like you can only configure one endpoint uri for the facility. Is this scenario possible with the existing RemotingFacility? If so, how? Thanks. ...

.Net - Load Type dynamically from AppDomain without remoting proxy

I've loaded a specific AppDomain up and I want to load some types dynamically from it (piece of cake right?). The thing is all of the CreateInstance methods of the AppDomain class return things as a remoting object handle. Remoting proxies have limitations that I would like to avoid such as: having to have serializable concrete classes, ...

How to change Href of custom Ribbon button in SharePoint 2010

Is there a way to change the Href of a custom ribbon button? I'm tring to tie the button to a lightbox, so that the lightbox is displayed when the button is clicked. The ID of the button is Ribbon.Documents.New.Controls.BtnUpload-Large so I tried jQuery('#Ribbon.Documents.New.Controls.BtnUpload-Large').attr('href', href), but that didn...

I wish to have a route named 'properties', but receive 404 error (Detects folder exists on disk)

Hey guys, I will try and be brief, I am finding when trying to create a custom route with a name and url of properties that my ASP.NET MVC app is returning a 404 file not found when hitting the route. I have deduced this down to most likely be caused by the fact I have a folder on disk called Properties which is of course a common asp....

Duck Typing DynamicObject derivate

I wrote a class that allows a derivate to which of its properties can be lazy loaded. The code is: public abstract class SelfHydratingEntity<T> : DynamicObject where T : class { private readonly Dictionary<string, LoadableBackingField> fields; public SelfHydratingEntity(T original) { this.Original = original; t...

Unblock Me Level Generator?

A rather specific question, does anyone know an existing piece of code on how to generate solvable levels for the game unblock me? OR what would the best approach to writing my own be? Typically how would you go about writing an algorithm to test and generate solvability and such? ...

Dealing with VB.NET Linq formatting in Visual Studio?

Does anyone else wrestle with getting VB.NET Linq code formatted the way they want it in Visual Studio? What are some tricks you have for how do you deal with it? I know that Visual Studio lets you uncheck the option for "Pretty listing (reformatting) of code", but most of the time it's a really handy setting to keep on. And with a te...

Displaying related, but non-foreign key data in a Silverlight datagrid column.

I have a Silverlight application which uses 2 separate databases. I have a situation where I have an Id column in one database, and the lookup table in another database. Obviously I cannot enforce this as a foreign key, and the Entity Framework will not let me build a single Entity Data Model for 2 databases, so I cannot define this rela...

C# - CryptographicException "Bad Hash"

I'm receiving a CryptographicException "Bad Hash.\r\n" from the code below when I call CreateSignature. Any ideas as to what might be causing this? RSAPKCS1SignatureFormatter RSAFormatter = new RSAPKCS1SignatureFormatter(new RSACryptoServiceProvider()); RSAFormatter.SetHashAlgorithm("SHA256"); byte[] signedHash = RSAFormatter.Cre...

Mobile applications built with .NET?

Can we develop mobile applications using .NET? Which mobiles are supported? Are those applications supported on all mobiles, or any particular mobiles? ...

Why should one use factory method to create objects

Possible Duplicates: Factory Pattern. When to use factory methods? Why do static Create methods exist? Though I know what is Factory Design Pattern. But I am unable to comprehend what are the benefits of using it. Why should we create objects using Factory Design Pattern. ...

Converting PCRE recursive regex pattern to .NET balancing groups definition

PCRE has a feature called recursive pattern, which can be used to match nested subgroups. For example, consider the "grammar" Q -> \w | '[' A ';' Q* ','? Q* ']' | '<' A '>' A -> (Q | ',')* // to match ^A$. It can be done in PCRE with the pattern ^((?:,|(\w|\[(?1);(?2)*,?(?2)*\]|<(?1)>))*)$ (Example test case: http://www.ideone.com/...

LINQ to Entities produces query containing datetime2 on SQL 2005 Express

I've got a LINQ to Entities app and a database project to manage the schema in a VS 2010 solution targetting .NET 4.0. The entity model is currently reverse engineered from the database. One of the tables is defined with a column of type datetime. The database project is configured to use SQL Server 2005 compatability mode and so it all ...

Merging MDI toolbar

In .net MDI application the menu of child form automatically is merged to the menu of parent form. Is there a way to do similar thing with the tool bars.The concept is to send the toolbar of active child to the parent toolbar stripe. I found http://community.devexpress.com/forums/p/5696/24663.aspx but could not achied it. ...