.net

SSO security considerations

Hi all, I have a sso mechanism already implemented thaty works perfect with redirects (site A redirects to SSO for login which takes it back to A after successful login) now I want to implement a set of web services to achieve the same functionality but without having to post back to the SSO service. The login works in the following ...

How to perform updates in entity framework 3.5 within an SqlTransaction

I'm working on a plugin that gets loaded via IOC from a 3rd party data driver. The plugin and data driver both operate on the same SQL Server 2005 database, but the plugin focuses on a small subset of tables that have foreign key relationships to the tables that the data driver manages. My problem is that in some operations, the data d...

404 Custom Error in IIS 6.0 and ASPX doesnt work

Hi, I've created a 404 error page called 404.aspx which works fantastic when I call it manually. But after setting the "custom error" in web.config and IIS 6.0. It doesn't work properly. for example, If I type the URL the wrong way, it won't work and a message like the one below, appears. XML Parsing Error: not well-formed Location: *...

IIS 7 - Difference between .NET Extensibility and ASP.NET

Hey guys, in the Windows Features control panel applet, under Internet Information Services --> World Wide Web Services --> Application Development Features, there are two options: ".NET Extensibility" and "ASP.NET". What is the difference between these two options? If I'm developing simple ASP.NET web applications / services, is there ...

Reactive Extensions for .NET (Rx): Take action once all events are completed

As a proof of concept, I want to write "Done" in a text box after a check box has been checked and a key has been pressed in a text box (in either order). I would expect this code to handle this, but it writes Done as soon as either event happens. Thanks for your help. var seq = Observable.FromEvent<EventArgs>(this.checkBox, "CheckedCha...

API choice, should I return XPathNavigator or XmlDocument

I'm building a new API for an existing service. The methods in it will be called from with in XSLT as .net extensions however I can see me needing to use the same API to do some .net XML juggling too. I've been toying which how best to write this all night. For it to be XSLT friendly I'll be returning XML in a XPathNavigator object so t...

Tuple.Create return type

Given void foo(Tuple<object> t) { } void bar() { foo(Tuple.Create("hello")); } the c# compiler returns error CS1502: The best overloaded method match for 'foo(System.Tuple<object>)' has some invalid arguments error CS1503: Argument 1: cannot convert from 'System.Tuple<string>' to 'System.Tuple<object>' Adding explicit types to...

LINQ to SQL default values

We all know that Linq to SQL (and SQLmetal/exe) is really a "prototype" quality product (it's missing basic features like schema "refresh" and detection of null columns with default value). Is there a way to automatically create my .dbml (similar to LINQ to SQL or SQLmetal) AND have it detect NOT NULL columns that have a default value? ...

Download the first 1000 bytes of a file using C#

Possible Duplicate: Download the first 1000 bytes I need to download a text file from the internet using C#. The file size can be quiet large and the information I need is always within the first 1000 bytes. This is what I have so far. I found out that the server might ignore the range header. Is there a way to limit streamre...

Performance Counter - Rate per minute type?

I have a service that processes relatively "expensive" requests. The average request rate is expected to be around 5-10 per minute. I would like to be able to monitor this rate with a custom performance counter, but all the available counter types seem to be geared toward much more frequently occurring events. What would be the best wa...

Process launched from service can't run Word mail merge in Win7

In Win7, I am running a service which launches a process which hosts the office-library (Word 2007) for the purpose doing a mail-merge. There is no interface anywhere. When I launch the mail-merge process with the service as the parent, Word cannot create a document using my existing mail-merge Word doc. At first I thought the problem wa...

When is a click event raised?

Looking at the MSDN documentation, it is not quite clear to me when a click event is raised. What is the order? is it: mousedown, mouseup, click? Thanks ...

Should I put KeepAlive inside my finally block?

So this tells me that I should put a GC.KeepAlive at the end of my code to keep my mutex open (to prevent multiple instances of my app happening due to early GC disposal of my mutex). But should I put the KeepAlive in my finally block or at the end of my try block? ...

Insert line number in Debug.Assert statement

We use Debug.Assert to signal problems in our code to the developer. I would like to add the line number where the error occurs but not hard code it as this could change and we would forget to update the string. It would be handy to add the line number of the error. Any ideas? ...

other problem with sqldatareader when the condtion in sql command is arabic

There is a problem with sqldatareader when the condtion in sql command is arabic like this: select user_name from users where typ=N 'arabic text' This does not retrieve any data although there is a user name which has this type so can you help me please ? thank ^_^ ...

Can the .Net 4 Client Profile be deployed via ClickOnce to non administrators?

I have deployed Windows forms applications regularly via ClickOnce that are installed by users that are not local administrators on their machines. Is there a way to also deliver the .Net 4 Client Profile the same way? From what I have read, I am guessing the answer is no. But I'm also hoping there may be a clever alternative. ...

Reproduce Windows Product Key Input

I'm starting to put together an activation dialog as part of my application. I really like the way Microsoft did theirs recently with Windows 7, more specifically the way the hyphens that separate each quintet of the product key are added and removed automatically. After taking a quick look at it, it seems like it's a bit more difficult...

WPF Sentinel objects and how to check for an internal type

Hi folks, As some of you have discovered, a new feature (?) appeared WPF 4, where the data binding engine may pass your custom control instances of the class MS.Internal.NamedObject with the name "{DisconnectedItem}" into the DataContext - instead of the data item your code is expecting (this happens when a templated control is disconne...

Winform->WPF MVVM Keybinding Error?

I need some assistance in getting WPF KeyBindings working when being called from a WinForm application. I've created what I think is the basic parts to demonstrate the problem. I can provide an sample application if that helps. The WinForm application starts a form which has a button that calls the WPF Private Sub Button1_Click(ByVal ...

Track progress when using Parallel.ForEach

I am refactoring my program to use Parallel.ForEach. Before, when I was using a regular for loop, I was updating a WPF progress bar using Dispatcher, displaying the % completed by dividing the current array index by the array size. With a parallel foreach loop this does not display properly i.e. % jumps eratically, which is expected. Ho...