.net

ASP.NET UDP socket code works in development, but not in production on IIS.

I have the following UDP broadcast listener running as a static component in a seperate thread on an ASP.NET web application. Why I would do this is really, unimportant, but the reason why this wont work when deployed baffles me. I do have several console applications sending UDP broadcasts, and I've coded tested and confirmed this thr...

What is the difference between marking a wcf method with [OperationContract(IsOneWay = true)] attribute and checking the generate asynchronous operations checkbox when adding a service reference?

What is the difference between marking a wcf method with [OperationContract(IsOneWay = true)] attribute and checking the generate asynchronous operations checkbox when adding a service reference? From what I have read, it seems the asynchronic nature of the call should only be defined on the client side. If that's the case, what is ...

How to call win32 CreateMutex from .Net

Hello, I've been successfully creating a .net mutex like this: SingleIns = new Mutex(true, AppName); for a while. It works in XP, Vista, but apparently not in Windows7. So I need to make an interop call to a Win32 library so other Com components can identify the mutex. I found the following code, but the Win32Calls. is not found... is...

Windows Forms Application Exits after Changing Theme

Hello. I am creating an application that has a RichTextBox that has text of varying colors based on what the information represents (red for errors, black for standard messages, etc). I am attempting to support Windows themes, and the possible variance of system colors. To do this, I created a method of changing the default text colors ...

.NET dll in PowerBuilder (as COM) problem with Lists

All, I am trying to access a .NET dll registered as a COM Object with PowerBuilder 10. I keep running into problems where .NET objects return lists. I have built out a very simple class for a proof of concept, and to better explain what I am encountering. See below: .NET: public class ListsArrays { public int[] GetArray() { ...

CollectionViewSource in CodeBehind with Template Bindings

I'm creating a lookless control based on Selector in WPF with a Dependency Property named "ListItems". When SelectedItems is changed, I do: // CollectionViewSource ListItems = ... ListItems.Source = newSelectedItems; ListItems.Refresh(); And In my control template I bind it to a listbox like this: <ListBox ItemsSource="{TemplateBindi...

URL-encode a URL

Is there a .NET encoding method I could use to encode a URL to be passed within a URL parameter? For example say I have: url_of_interest = "http://asdf.asdf/asdf.htm" and I want to include this as one (1) URL form parameter when I do an upload to a web-application: http://mywebservice/upload?url=&lt;&lt;encoded URL here>> ...

Waiting for Event Triggering in Silverlight Unit Tests

I am using the Silverlight Unit Testing Framework to test some View Manager classes. Some tests require the PropertyChanged events to be fired. I'm currently using a combination of EnqueueConditional and WaitHandles Example 1 [TestMethod] [Asynchronous] [Timeout(1000)] public void TestNotificationExample() { var manager = new User...

Most effective way to connect/retry connecting using C#?

I am creating a little game client that will end up connecting to a server to gather some information on available games to play, how many players are playing, and all kinds of other stuff that you can imagine it ought to do. My difficulties come in finding an effective way in dealing with the connect/retry connect sequence upon first l...

Does AL.exe work with X.509 Certificates

I would like to delaySign and later fully sign .NET assemblies with X.509 Certificates. How would I do this? ...

Need C# regexp for URL validation

How to validate by a single regular expression the urls: http://83.222.4.42:8880/listen.pls http://www.my_site.com/listen.pls http://www.my.site.com/listen.pls to be true? I see that I formulated the question not exactly :(, sorry my mistake. The idea is that I want to validate with the help of regexp valid urls, let it be an externa...

choose MySQL or choose SQL Server Express (free)?

Hello everyone, I need to develop a mid-sized Inernet facing web site (e.g. less than 1000 users) for information sharing and simple workflow. Since limitation of budget, I am choosing free database. And since the developers are familiar with .Net, C#/ASP.Net is the choosen programming language. I am using Windows Server 2008 x64 editio...

Error-reporting framework for .net

Hello, is there an error-reporting-framework you would suggest for use in .net. I need possibilities like e-mail-reporting with fileappending to e-mail. The user should have the possibility to add information to the report and also should have the possibility to remove report-files, i.e. if they contains privacy-critical data. There als...

.NET property changed sensitivity

I need to make a instance of some class to provide informations when it's property is being changed. Basically I am trying to implement a binding mechanism, which will watch the properties of the bound class and inform the system that the property has been changed. The only solution I have found is to: Add an event PropertyChanged us...

.NET/ASP.NET and placeholders in databases

I have a web page (ASP.NET, ASCX) which has to show some contents of a database. The choice of contents is determined by some variable, say x. So, if x=1, I show the first column of a given database table, if x=2 I show the second column and so on. I am told that I need to use a thing called "placeholder". Can anyone show me how to do...

Custom windows error reporting on Windows XP

Is there a way to customize the data used in windows error reporting on Windows XP SP3? I have a managed application (CLR2.0) and I'd like to create a custom minidump (containing some additional user information) in case of a unhandled exception. This minidump shall then be sent as part of the WER. Thanks, Thomas ...

View raw XML request

I am very new to WCF and SOAP messaging but I have managed to put together a reasonably good client which I am using to download news stories from a media organisation. I have generated proxy classes which obviously abstract a lot away and mean that I am basically just creating objects, calling methods and iterating through results. My ...

Does log4net support including the call stack in a log message

I wish to include the call stack (e.g. the methods that called me) in a log4net message. Is there a standard way of doing this? (I know this will be slow, but I only need to do it on some errors) ...

Draw a new Curved Shape inherited from LineShape

Hello, I use Microsoft.VisualBasic.PowerPacks. LineShape component. This component is good, but I want to draw a curve instead of a right line. I stardet to modify the OnPaint: protected override void OnPaint(PaintEventArgs pevent) { //base.OnPaint(pevent); pevent.Graphics.DrawLines(Pens.Green, new ...

Async function - callback using object owned by main thread

In my .NET application built with WPF and C# I call an async function using AsyncMethodCaller. In the callback I'd like to update some data in the GUI, but I'm not allowed to as this is owned by the main thread. How to I do it? Invoke an update on the main thread? How? Pass an object (e.g. ViewModel) as state to the callback and upda...