.net

.NET HttpListener: when registering both HTTP & HTTPS I get "conflicts with an existing registration on the machine"

I'm trying to use .NET HttpListener in a C# project. When I register my prefix "http://*:8080/" it does not seem to work for HTTPS urls (i.e. doesn't pick them up). When I try the following code to register both the HTTP and HTTPS versions of the prefix however I get the error: "Failed to listen on prefix 'https://:8080/' because it c...

Is there a pure-managed DirectX wrapper?

I'm currently in need of a purely managed code DirectX wrapper for .NET. While SlimDX is great, its use of unmanaged code makes it impossible to perform proper dead code analysis on, for the purpose of merging it into your assemblies. With a pure managed wrapper, I'd be able to include just the pieces I use in my assembly, allowing ver...

Why do properties behave this way?

From http://csharpindepth.com/Articles/Chapter8/PropertiesMatter.aspx using System; struct MutableStruct { public int Value { get; set; } public void SetValue(int newValue) { Value = newValue; } } class MutableStructHolder { public MutableStruct Field; public MutableStruct Property { get; set; } } cla...

.NET - Is it possible to proxy a HTTPS request using HttpListener & HttpWebRequest? (or is it not possbile due to the encryption?)

Hi, Question - Is it possible to proxy a HTTPS request using HttpListener & HttpWebRequest? (or is it not possbile due to the encryption?) I have got a .NET proxy working by using HttpListener & HttpWebRequest using the approach here. I'm trying to extend this at the moment to listen for HTTPS too (refer this question) however I'm won...

Show a taskbar item with a NativeWindow

My application is intended to work almost entirely through a Windows 7 taskbar item with the use of thumbnails and jump lists. I know I can easily create a Form and simply hide it, but this seems like overkill. Plus, I'd like to toy around with NativeWindow as much as possible, because I've never used it before. Essentially, I have a cl...

Checked list box

i want to do some actions when all items in checked list box are unchecked. There is only event ItemCheck but the check state is not updated until after the ItemCheck event occurs. I have a button and i want to do its enabled false when all items unchecked in checked list box System::Void frmMain::clbInstPrgs_ItemCheck(System::Object^ ...

Customize ToolStripMenuItem

Hello everyone, I want to customize ToolStripMenuItem by overriding OnPaint function. This is a MyToolStripMenuItem: public class MyToolStripMenuItem : ToolStripMenuItem { public MyToolStripMenuItem() :base() { } public MyToolStripMenuItem(string t) :base(t) { } protected override void OnPai...

Convert Test Projects in VS 2008 to 2010

We are currently building the framework for developing a C# .net application using visual studio 2008. We are considering our options wrt. the unit test code for this project. One option is the Test Project in Visual studio. I need to clarify if these test projects will convert to 2010 correctly or any difficulties that may arise. ...

Looking for .NET library to create PDF

We are looking for a .NET PDF creator. It needs to be .NET, so we can just copy the file(s) onto the server, not having to install anything. We only need to create a PDF with some text and images and a heading, that's all. Anyone know a good one? We are happy to buy if there is a good one that is easy to use. Thanks in advance. ...

Problem using UnhandledException in Windows Mobile app

I have a Windows Mobile program that accesses an attached device through a third-party DLL. Each call to the device can take an unknown length of time, so each call includes a timeout property. If the call takes longer than the specified timeout to return, the DLL instead throws an exception which my app catches with no problem. The p...

Print on a background thread

Hi I want to print a html page from c# application but on a back ground thread because if I print the doc on main thread UI freezes for few seconds and I dont want that. I have tried WebBrowser control but it need to be hosted on some form to get it work. Hosting this control is still acceptable but Print method needs to be called fro...

How could I run a WM6.0 program on WM5.0

I have a testing PDA running on WM6.0. But my client uses WM5.0. Is it possible to build the program(c# by VS) so that I can test on my PDA and run on my client's PDA? (emulator doesnt take count) Or any thoughts? ...

Compact Framework targeting

If a smart device project is set to target CF 2.0, Windows CE 5.0, should this same application run on Windows Mobile 6 with CF 3.5 installed? I was able to install it (the CF 2 app), but when running received an error stating that the assemblies could not be loaded and that CF might not be installed. This has led me to belive that smar...

TimeZoneInfo vs. Olson database

Do TimeZoneInfo and Olson database use identical identificators for time zones? I get timezone id from GeoNames service (which is based on Olson database) and want to retrieve day light saving information for that timezone. ...

XML Serialization and Soap Serialization

Hi I think even if we will not need interoperability between applications, and even we do not communicate with web services, it is easier to serialize using SoapFormatter than XmlSerializer because SOAP will serialize the private members by default, while XmlSerializer will work on public properties and fields. actually I cannot find a...

Enabling Session State in ASP.NET MVC

I'd like to use session variables in my ASP.NET MVC application. I already added the <sessionState> tag in my web.config file like this <sessionState mode="InProc" cookieless="false" timeout="20"> </sessionState> I get a session ID in my url like this if I use cookieless="true" http://localhost:2967/%28S%28hcawmi55zoruuy453fbo3k...

SQLCLR and DateTime2

Using SQL Server 2008, Visual Studio 2005, .net 2.0 with SP2 (has support for new SQL Server 2008 data types). I'm trying to write an SQLCLR function that takes a DateTime2 as input and returns another DateTime2. e.g. : using System; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; namespace MyCompany.SQLCLR { public ...

nHibernate query looking for the related object's related object

I have an nHibernate querie issue that looks quite straight forward, but I can't seem to get my head around it! I am creating some simple example classes to illustrate my problem: public class Car { public int Id { get; set; } public IList<Interior> InteriorParts { get; set; } } public class Interior { public int Id { get;...

Specifying type when resolving objects through Ninject

Given the class Ninja, with a specified binding in the Ninject kernel I can resolve an object doing this: var ninja = ninject.Get<Ninja>(); But why can't I do this: Type ninjaType = typeof(Ninja); var ninja = ninject.Get<ninjaType>(); What's the correct way of specifying the type outside the call to Get? ...

Microsoft.Practices.ServiceLocation and TryGetInstance

Why Microsoft.Practices.ServiceLocation.IServiceLocator does not offer TryGetInstance()? I need to get generic validator instance ServiceLocator.Current.GetInstance<IEntityValidator<TEntity>>() but not all Entities has registered validator. The only solution i found is to use try{}catch{} block, but i dont like this approach. ...