.net

Returning HttpStatus codes with message from WCF Rest service that IParameterInspector AfterCall can handle

So then, I've got a number of methods in a a couple of services that I've decorated with a custom attribute. That attribute uses the ApplyDispatchBehavior from IOperationBehavior to attach to the method and the BeforeCall and AfterCall methods from IParameterInspector to do some processing before and after the service method is called. ...

Must scenario for events related to Multithreading in C#?

I am wondering that in which scenario we must use events technique in multithreading and there is no other way around? I have seen cases we may use another syncronization techniques like Monitor wait and pulse to implement this. Can anyone help me out to understand events in Multithreading ? ...

C# async soap object handle

Is there a way to attach a handler to a soap call? For example: I’m calling a row validate for each row in a data grid. This then calls async soap service. On the return of the async is it possible to know which row i called it for without passing some sort of id back and forth? Thanks ...

Free POP3 mail component

Right now I'm working on a project, which will read mails from pop3 inbox and save its attachments to specified folder. I'm looking for a free POP3 mail component, which can be used with .NET 3.5; Please recommend easy to use POP3 component, it will be great if it is open source. ...

What NoSQL solutions are out there for a .NET develop for a DMS

We should start the develop of an application...DMS - Doocument Management System. Which is the best solution for a NoSql database (document database?) ? We are develop in .net --> so c#, linq and silverlight. ...

.NET Target Framework Performance

I have a .NET 4.0 class libary, which only uses .Net 2.0 features. To make this library more compatible with Mono, I'm considering changing the Target Framework to 2.0 instead of 4.0 Client Profile. But the question is: Does changing the Target Framework to an older version, make the library run slower (hurt performance). The GUI of the...

How to solve Optimistic Concurrency Updates in c# .NET N-tier applications?

Hy everyone. In c# .net VS 2008 I'm developing an N-tier CRM framework solution and when it's done I want to share it. The architecture is based on: Data Access Layer, Entity Framework, Bussines Logic Layer, WCF and finally the presentation layer (win forms). Somewhere I had read, that more than 2 tier layers are problematic, beacus...

Passing an image through as webservice

Hi, how would I go about passing an image from an ASMX webservice, through to my silverlight front end? I am using .Net 4.0 and Silverlight 4 front end, and SQLServer 2008 to store the image. ...

Debugging ideas for a blocked Windows Message loop

I have a longstanding C# .NET 3.5 application 'freeze' which I am at a loss with. There are two C# executables. One has a full UI, the other runs as a tray app. They both communicate via WCF to a third service app, also running in the tray. Randomly the UI thread of main Winforms app will deadlock. Mysteriously if I quit the tray app t...

wpf how to inscrib rectangle in elipese

Hi I have quite a big problem. I draw elipse using Path element in wpf. My ellipse looks like that <Path x:Key="MainPath" Fill="{StaticResource DefaultBrush}" Stretch="Fill" Grid.RowSpan="2" Data=" M453.5,140.5C453.5,217.81986 352.0925,280.5 227,280.5 101.9075,280.5 0.5,217.81986 0.5,140.5 0.5,63.180135 101.9075,0.5 227,0.5 352.0925,0.5...

How to write contents of one file to another file?

I need to write contents of a file to another file using File.OpenRead and File.OpenWrite methods. I am unable to figure out how to do it. How can i modify the following code to work for me. using (FileStream stream = File.OpenRead("C:\\file1.txt")) using (FileStream writeStream = File.OpenWrite("D:\\file2.txt")) { BinaryReader ...

Unused imports in .NET

The VB.Net IDE allows me to scan for unused references. But I also have a lot of unused imports in my application. Is there a way to scan for unused imports in all classes, or does having an unused import not hurt the performance of my application? ...

How can I wait for a signal before proceeding compilation of other code segment

Can I wait for a signal from a event so that , when I recievce the signal then only I will proceed with next code segment. For making it clear , I have the follwoing code: hiddenMediaElement.Source = new Uri(strMediaFileName, UriKind.RelativeOrAbsolute); hiddenMediaElement.MediaFailed += (obj, Sender) => ...

How unloading an application can affect another running application

Application domains allow applications to be unloaded separately. My question is how unloading an apllication can crash another application. Any example? ...

How to export non-exportable private key from store

I need to export private key from Windows store. What should I do if key marked as non-exportable? I know that it is possible, program jailbreak can export this keys. To export key I use Org.BouncyCastle.Security.DotNetUtilities.GetKeyPair() that export key from (RSACryptoServiceProvider)cryptoProv.ExportParameters(true). Exported key I...

Storing error numbers and message text centrally

I'm currently re-organising our collection of around 6 windows services which includes bolstering their robustness and error logging. We have a new central service manager where our services can phone home and also raise events which in turn can be farmed out to relevant technical contacts if needs be. What I want to do is centralise e...

Any way to be able to install the same ClickOnce app from two different locations?

We build the application once, and then deploy it to multiple sites. I can install it from any of the deployed servers, but I cannot have it installed from multiple at the same time. I understand that this is a limitation of ClickOnce. Is there any way to trick ClickOnce into allowing this to work? Or any site-specific post-processin...

Is it possible to figure out WHAT is changing in a RowChanging event?

The DataTable class has RowChanging as well as RowChanged events, which is convenient (for those of us foolish enough to be using the DataTable class in the first place). Event handlers for these events take a parameter of type DataRowChangeEventArgs, whose properties comprise a DataRowAction (Add, Change, Delete, etc.) and the DataRow b...

DataGridView bound to BindingList<> Not showing values in RELEASE mode ??

Following code works in debug mode, but in release mode there are only blank rows shown, with only an icon per file. The file list is correct, since in another mainmenu item the files show correctly ?? private void FillFileLinks() { dataGridView1.AutoGenerateColumns = false; string[] files = GetFileList(); ...

sql bulk insert with additional column

Hi, A csv file contains 8 columns (col1, col2, ..., col8) and the name of the file contains the date which has to be inserted into the table as well. If the number of columns in the table and columns in the csv file are equal the following query imports all the records from the file to the table: query += "BULK INSERT real_data FROM '...