.net

Is there a way to do TRUE bidirectional communications over a single TCP connection in WCF?

I have a WCF server that exposed an interface that has a call-back interface it uses to send events to the clients. I rather not mark all the methods on the call-back interface as “OneWay”, as it make error tracking and logging harder. The client is written in WinForms, so the call-backs will not be processes until after the call to t...

How can one specify the window title for a console application started with System.Diagnostics.Process.Start()?

Dear ladies and sirs. I am starting a new instance of a console application from my .NET code using the Process.Start() method. I was wondering if I can specify the title of the console window hosting the spawned process. Could not find anything suitable in ProcessStartInfo. As a last resort I can P/Invoke to talk to Win32 API directly...

404 Errors only with .aspx extensions

I have a .NET 2.0 application running on IIS 6. When I choose the browse option on .gif and .txt files they appear in the browser. When I choose to browse to any .aspx page, I get a 404 error not found. The site is an IIS application and the bin directory has the required .dll files. There are no events in the event log. ...

What WCF binding is most performant?

I have to get the maximum throughput performance in my WCF service. In one of my tests the service below got only 50k data items per minute using NetTcpBinding. Would a disconnected binding like NetMsmqBinding improve this performance? Service and client uses WCF and run in the same machine. [ServiceBehavior(InstanceContextMode = Insta...

C# books that cover 'real world' uses

Background Very few of the .NET and C# books I've read actually cover real world examples and uses for C#. For example we learn about collections and other useful aspects of the language but I haven't seen a book that explains when to use them. Question Is there a book that covers real world uses for various parts of the C# language ...

Proving SQL Injection

I'm trying to simply prove here that this simple function isn't good enough to prevent every sql injection in the world: Function CleanForSQL(ByVal input As String) As String Return input.Replace("'", "''") End Function Here is a typical insert statement from one of our apps: Database.DBUpdate("UPDATE tblFilledForms SET Text1 = '...

How to encode/decode video using C#?

A little background, I was given the task of fixing a few "small" bugs and maintaining this solution for streaming video across the network between two instances of our application. The solution was written by someone who is no longer here so there is some mystery in the code as well as some really fun pitfalls. The solution was writte...

How to call a shared member on types with different types?

I have different sets of custom Winforms controls all deriving from Control such as: CalculatorPanel, GraphPanel, DisplayPanel, etc : Control I use a single Form to display one or more of these sets depending on what the user wants to see. All of them has a member called: Input where the type is different such as: CalculatorInput...

exceptions across module boundaries in C++/CLI

Item 62 of Sutter and Alexandrescu's book "C++ Coding Standards" is "Don’t allow exceptions to propagate across module boundaries." Should we follow the same rule in C++/CLI? ...

How should I handle queuing wcf messages?

I am implementing a WCF service based on a 3rd party WSDL. Rather than process the messages synchronously, I want to dump the xml into a database, and have it processed by another part process. Is using the WCF Message class directly the right way to go ab out this? Or should I just let WCF deserialize the message and the re-serialize...

Updating assembly causes error

I updated a single 3rd party assembly, and I am getting an error: Could not load file or assembly 'Some.Assembly, Version=1.0.3.15922, Culture=neutral, PublicKeyToken=62a6874124340d6e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Wh...

Help to improve a migration program

We have 200+ views in Oracle that should be transfomed to 200+ flat files with fixed length fields. Hoping to get ideas to do a better design of the following migration routine. The prototype of migration program looks like this for the view named VIEWNAME1 (and are the same for other views in the prototype): StronglyTypedDataSet view...

Releasing a COM object reference safely from .NET

I have read a lot of articles on the net about releasing RCW's safely, and it seems to me that no one can agree on exactly what needs to be done in what order, so I'm asking you guys for your opinions. For example, one could do this: object target = null; try { // Instantiate and use the target object. // Assume we know what we ...

PNRP + dont see Global_ on Windows 7

Hi, Im trying to test out PNRP in a simple app that either registers or resolves. On my Vista machine when i run 'netsh p2p pnrp cloud show list' .... I see Global_ When i try this from my Windows 7 machine i do not see Global_ i only have LinkLocal_... I can see i have an IPV6 address on the Windows 7 machine (via ipconfig) I may ...

Disable ASP.NET ImageButton in non-IE Browsers

I have an <asp:ImageButton /> which has its enabled property set to false. This works in Internet Explorer, the button is not 'clickable', but in other browsers you can click it. However, nothing happens when you click the imagebutton in these other browsers. How can I disable the ability to click the button in browsers outside of Int...

Can I use the .Net CF unhandled exception dialog to display and exception that was caught?

In my .Net 3.5 Compact Framework app I recently added an unhandled exception handler. I did it just so I could add the error to our log file and reboot the system. In certain modes I want to display the error to the user. I find that the messagebox is far inferior for error display than the dialog the CLR would use if I didn't catch th...

Problem with serialization derivative class in C#

I have a code like this: [Serializable] public class A { public int X { get; set; } } [Serializable] public class B : A{ } [Serializable] public class C { public A A { get; set; } } ... public string Serialize<T>(T obj) { StringBuilder stringBuilder = new StringBuilder(); TextWriter stringWriter =...

Is there any way to do custom serialization in WCF?

In my WCF solution, the server doesn't need to know the data type. The client will send a type and receive the same type. For performance reasons I think I could implement serialization manually in the client proxy, avoiding WCF builtin serialization on the server side, but there is any way to achieve the same goal just configuring WCF ...

Get list of classes in namespace in C#

I need to programmatically get a List of all the classes in a given namespace. How can I achieve this (reflection?) in C#? ...

Specifications for Servers for Team Based Development

Background My business is getting more and more requests for web development and as such I'm adding another .NET Developer to the team. My current development environment is really poor, just a single PC (Windows XP) with a local IIS installation hosting web development projects. I open those with Visual Studio 2008 Professional, with ...