.net

X509Certificate and SSL

Trying to do basic SSL-authenticated Web Service using Visual Studio 2008 .NET 3.5 "Service Reference" object created from WSDL. We have tried three methods 1) Setting Client Certificates (to match server-supplied), 2) setting store for server-supplied, and 3) using custom server validator. The .NET exception (detailed below) is consis...

backup not made

i did not make a back up of a project and SVN Merged it using Tortoise with another project. It was not checked into SVN so there was no version to revert back to. Is there any way of recovering that project back? ...

C# .Net MSMQ Receive() method timeout problem

My original question from a while ago is MSMQ Slow Queue Reading, however I have advanced from that and now think I know the problem a bit more clearer. My code (well actually part of an open source library I am using) looks like this: queue.Receive(TimeSpan.FromSeconds(10), MessageQueueTransactionType.Automatic); Which is using the ...

Getting URI's for XAML types at runtime

I'm trying to make a bit of code like this work: Type pageType = typeof(Page1); Uri pageUri = GetPackUriForType(pageType); The problem is the GetPackUriForType method - I can't find anything in the .NET framework that will do this. In the .g.cs files that are built at compile time, the URI is embedded as part of the InitializeCompon...

C#/.NET: Creating SPECIFIC Dynamic Visuals - House Plan w/ Objects (FOLLOW-UP)

Yesterday, I asked a question about how to dynamically render something in .NET: specifically, I asked about how to create a white "canvas" for "drawing"/rendering upon, what framework to use, etc. However, many of the answers suggested for me to ask a more specific answer, so right now, I have come up with a completely hypothetical (and...

alternative to SVN Merge

I find the whole process of merging two projects (one committed to SVN the other not) very lengthy. Manual changes are too many and too hard to make the new merged project compile. Is there any alternative to this ? The project that is not Checked into SVN has a backup. I do not want to use softwares such as Python etc. ...

Viewing dataset contents without using dataset visualizer

In writing some tests for a project I'm working on, I found that the best way for me to get the data back I needed about whether the project was correct was to put results into an ADO.NET DataTable. I got sick of setting breakpoints and waiting for them to be hit so that I could use the DataSet Visualizer to see what my results were, an...

DLR DefaultBinder available for use in Silverlight?

I'd like to use the Codeplex DefaultBinder from within a Silverlight-deployed DLR project (my own custom language implementation). Is that possible? Is the DefaultBinder compatible with Silverlight 3 and/or 4? ...

Where do you store files(such as images) on Windows Mobile 6 phones?

Hi I want to have a couple images in my phone application. However I don't know where to store them. Like I add them to my VS project but of course the image path is the path on my harddrive. So is like special folder in windows mobile where I store it. Like if I transfer my application to the phone I am going to have to stick this ima...

Not sure why my reader won't read my text file

I have the following code to read a file in the root directory of my application. For some reason, no matter how many runs, my file is still not being read. Any idea what I could be doing wrong here please. Thanks in advance. byte[] mybytes = null; if (File.Exists(filename)) { using (StreamReader sr = new StreamReader(new FileStream...

How do I set the transparency key for a button in windows forms?

I'm using standard BMP images for buttons that come with visual studio. When using these images within a resource (resx) file, how do I set the transparency key? This has always worked fine for me using an ImageList, but I want to reuse the images among many dialogs within the same assembly which I would also like the ability to control...

What is faster: web service or XML server output?

The Central Bank of Russia as any other central bank provides a service to get exchange rates between ruble a number of other world currencies. Web service: http://www.cbr.ru/DailyInfoWebServ/DailyInfo.asmx XML output: http://www.cbr.ru/scripts/XML_daily.asp?date_req=25/11/2009 .NET can easily read both. But what is faster and more re...

C# 2005 console application always requires elevated privileges

Hi, I am trying to build an automation application in C# 2005 express edition under windows vista. Problem is, Whenever I try to run this application, either from IDE or directly compiled executable under vista, it asks for elevated admin privileges, same executable runs under XP normally though! I'm unable to understand if this proble...

Best Practice: Organize Unit Tests.

Hello there, I have solution with >270 projects, it contains various folders and etc. Imagine each project have Unit Tests, what do you think what is the best way to organize them? Should each project have Unit Tests near by, or I should create special folder for them, or even different solution for just unit tests. How do you organi...

Synchronization between two processes in C#.?

Is there any way so that we can synchronize two independent processes? Like if they are sharing a resource, I would like to sync them. I am using C#. ...

How To Figure Out if an HTML Block Does Not Contain Any Text Nodes

How do you/is there a way to figure out if a block of HTML contains zero text nodes? e.g. this: <p><div><span></span></div></p> contains zero text nodes whereas this: <p>Stuff</p><div><span>other stuff</span></div> contains two. Additionally, you're guaranteed that the HTML is XHTML-compliant and the content is probably less tha...

Log4Net and extra fields

Hi, Is it possible to insert extra fields into the database and use them in log4net? I have a UserId I would like to have in an extra field in the log-table. I have added the field in the log4net.config: <parameter> <parameterName value="@userid" /> <dbType value="guid" /> <layout type="log4net.Layout.RawPropertyLayout" /...

Dot net 3.5: does dot net 3.5 provides some api to calculate crc32 for input data?

Does dot net 3.5 provides some api to calculate crc32 for input data?I have got some links which provides source code to do so.But i want to use Dot Net Api's code. ...

Change Page size of Wor Document using Open Xml SDK 2.0

Hello everyone, My application needs export custom report to Word document using Open xml Sdk 2.0 My Export function works fine except I need to increase Page size for showing it properly. (else word wrap will be an issue and Report won't look nice). Can any one suggest me how can I adjust Page size according to width of my report. I...

Raising an event thread safely

I'm sure I've seen this around before but I'm wondering how I should raise an event thread-safely. I have a message despatch thread which looks somthing like. while(_messages > 0){ Message msg; // get next message if (MessageDispatched != null) MessageDispatched(this, new MessageDispatchedEventArgs(msg.Msg, msg.Pa...