.net-4.0

Effectively highlighting column and row on a DataGridView as mouse moves

I am trying to highlight the row and column which the mouse is on. Essentially this means to change the background color of all the appropriate cells. Currently I am trying to do this in the MouseMove event. However, this is causing slow performance. I was suggested to use WPF for better performance, however I do not wish to go that rou...

Return .plist from .NET WCF4 Web Service

Hi, I recently listened to the WWDC 2010 discussion Session 117 - Building a Server-driven User Experience. The presenter discussed the performance difference between processing XML vs. JSON vs. plist. plist was much faster and about the same size as XML (worse than JSON, but much faster processing). I am wondering if anyone knows of...

Unsigned SAML 2.0 Support for WCF on .Net 4.0

Hi All, Can someone please let me know if unsigned SAML 2.0 or 1.1 is natively supported on WCF .Net 4.0. I know that Signed SAML 1.1 is natively supported on WCF and SAML 2.0 is natively supported on WIF but I am not able to find any material regarding unsigned SAML. ...

DataGrid new row added event

I have a datagrid with a long content list and its first row is selected as default. I want the scrollbar of the datagrid to be scrolled to the bottom, when a new row is added. I thought I achieved this by a selectionChangedEventHandler and scrollIntoView(item) method, but I just realized that when I try to scroll down by hand-without ch...

Is there a way to unload or reload the currently loaded runtime?

Ever since we started upgrading some of our projects to .NET framework 4.0, I've been running into a lot of issues regarding the following error: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. It's now happening with our installer application. The installer goes through a list ...

can't get System.Web.SessionState with asp.net 4 webforms routing

I've seen couple of questions here such as http://stackoverflow.com/questions/161221/state-service-when-using-system-web-routing-in-webforms but couldn't find proper solution. I am using asp.net routing with webforms on iis7. I've added below to webconfig file to get it working at first palace <system.webServer><modules> ...

c# .Net4 webRequest over SSL not working

Hi this works when posting to an http address but fails when posting to an HTTPS address with can't estabilish a trust relationship! What do I need to do to this or is this a server error!? private static string HttpPost (string uri, string parameters) { //return "ok"; // parameters: name1=value1&name2=value2 try { ...

Cancellation token in Task constructor: why?

Certain System.Threading.Tasks.Task constructors take a CancellationToken as a parameter: CancellationTokenSource source = new CancellationTokenSource(); Task t = new Task (/* method */, source.Token); What baffles me about this is that there is no way from inside the method body to actually get at the token passed in (e.g., nothing l...

Service Routing Table works in IIS7 but not IIS6?

I've got a WCF service that uses a Global.asax file to activate my services. So, my deployed virtual directory on my deployment box looks like web.config global.asax - which contains Services.dll and Services.pdb the Services.dll is the compiled bits of my Service.svc and Service.svc.cs files. How do I get this setup to work in IIS6?...

Exception for when multiple files not found?

Is there an exception that I can use for when there are one or more files not found? I'm doing this: filePaths.Where(file => !file.Exists); and I need to throw some kind of FilesNotFound exception. Do I need to inherit from Exception and make my own exception class? I'm using C# .NET 4. ...

DeploymentItem fails copying directories when there are multiple test projects per solution

I have a number of test classes and methods that copy a particular directory like so: [TestClass, DeploymentItem("LanguageData", "LanguageData")] public class OcrTests { [TestMethod] public void Can_Capture_Field() { // some code that expects the LanguageData directory to be in the test results Out directory } ...

Error when trying to find Ribbon Control Resource Dictionary - Office2007Blue

I keep getting an error #6 (An error occurred while finding the resource dictionary "/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml") when I try an load the Office2007Blue resource dictionary that is supposed to come with the WPF RibbonControlLibrary. Has anyone seen this problem and found a fix? I'm using version 3.5.4072...

ASP.NET 4.0 Charting - How can one display a explanatory message in the chart area when the databound query returns no results?

I have a .Net 4 Chart Control bound to stored proc. For some customer selected queries the chart will be empty. I would like to display a "No data" message in the empty charting area so customers understand why the chart is empty. I haven't been able to find any information about how to do this. ...

C# 3.5 winforms app upgraded to C#4.0 issue because of the exclusion of CAS

I have a C# 4.0 Winform app that I just upgraded from 3.5 to 4.0. The C# 4.0 Winforms app references a C# 3.5 dll that will load a series of dlls from network paths based off of user selections and then create/invoke the dlls using System.Reflection. Everything worked just fine when the application was set to use 3.5 as the target fram...

How do I use GZipStream with System.IO.MemoryStream?

I am having an issue with this test function where I take an in memory string, compress it, and decompress it. The compression works great, but I can't seem to get the decompression to work. //Compress System.IO.MemoryStream outStream = new System.IO.MemoryStream(); GZipStream tinyStream = new GZipStream(outStream, Comp...

CS0012: The type 'System.Xml.IXmlLineInfo' ...

I have an .aspx page (using MVC 2) When i'm trying to make an actionlink i get an error (you can see below). This code worked already, but since i updated my project (it's a silverlight project) to .net 4.0 it gives me that error.. Error: CS0012: The type 'System.Xml.IXmlLineInfo' is defined in an assembly that is not referenced. You ...

Adding methods to ExpandoObjects

UPDATE The problem is not the code, the problem is that you apparently can't evaluate dynamic objects from the immediate window. I'm trying to tack on methods to an ExpandoObject but not sure how to get it to work. Here's my code: dynamic myObj = new ExpandoObject(); myObj.First = "Micah"; myObj.Last = "Martin"; myObj.AsString = new ...

Refreshing ComboBox Data Binding in C# and .NET 4.0

I have a ComboBox (Windows Forms) that is bound to a List. It is created at design time. When the List contents are changed my code calls a function to refresh the data binding. This works fine for .NET 3.5: BindingData.SuspendBinding(); DataSource = null; DataSource = BindingData; BindingData.ResumeBinding(); I have switched to .NET ...

Problem with .NET 4 based SMTP OnArrival sink in Win 2008 R2

I had .NET 3.5 implementation of OnArrival sink for SMTP server that has been successfully running for years. When I recompiled it to .NET 4 and reinstalled it the SMTP server stopped picking it up. I suspect it has something to do with the default verion of .NET used by SMTP server interop to communicate with the sink (it seems that it ...

SQLMetal Multiple Foreign Keys Pointing to One Table Issue

Edit - Cleaning up question to better reflect the actual issue: I'm using SQLMetal to generate database classes from our SQL Server db. Recently, I needed to add a table that had multiple foreign keys pointing to the same table. Using LINQPad to play around with the new tables, I was able to access properties for both foreign keys like ...