.net-4.0

Is the .NET 4 Framework going to change?

Is the .Net 4 Framework going to change before the "go-live" or can we safely assume that the framework will stay the same as it currently is in the Release Candidate? ...

Validation Application Block and .NET 4.0 Code Contracts

Has anyone implemented the Enterprise Library VAB along wtih Code Contracts in .NET 4.0? If so, can you share some insights? Did it help in performance? Any other factors to be considered? ...

Does "for" in .Net Framework 4.0 execute loops in parallel? Or why is the total not the sum of the parts.

I am writing code to performance test a web site. I have the following code: string url = "http://xxxxxx"; System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); System.Diagnostics.Stopwatch totalTime = new System.Diagnostics.Stopwatch(); totalTime.Start(); for (int i = 0; ...

How do I allow inline images with data urls on .NET 4 without triggering request validation?

I'm using the jQuery jstree plugin (http://jstree.com) in a ASP.NET MVC 2 project on .NET 4 RC, and running on IIS 7.5. It comes with some stylesheets with inline images with data urls, like this: .tree-checkbox ul { background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==); } Now,...

Sharepoint 2007 and ASP.NET 4.0

Is it possible to create ASP.NET 4.0 "_layouts" pages in Sharepoint 2007 (WSS or MOSS)? ...

Where do I find a list of changes and bug fixes for .Net classes from 3.5 -> 4.0?

I'm having trouble finding a list of the changes and bug fixes that have been made in the .Net framework for .Net 4.0. They're not easy to find, but surely they exist somewhere? Specifically I want to find out what changes and updates have been made for System.Net.HttpWebRequest and System.Net.CookieContainer, as both are quite bugridde...

WCF DataContract with readonly properties

Hi, I'm trying to return a complex type from a service method in WCF. I'm using C# and .NET 4. This complex type is meant to be invariant (the same way .net strings are). Furthermore, the service only returns it and never recieves it as an argument. If I try to define only getters on properties I get a run time error. I guess this is b...

What is the proper way to handle non-tracking self tracking entities?

Self tracking entities. Awesome. Except when you do something like return Db.Users; none of the self-tracking entities are tracking (until, possibly, they are deserialized). Fine. So we have to recognize that there is a possibility that an entity returning to us does not have tracking enabled. Now what??? Things I have tried F...

Trouble Deploying .Net Framework 4 Website on IIS7

Okay, I am trying to deploy a .Net framework 4 website on IIS7 server. I have already changed the application-pool's target framework to .Net 4, but the app is still showing me the error: "The configuration section 'system.web.extensions' cannot be read because it is missing a section declaration" I am guessing that has something to do...

Workflow 4.0 code activities calling other activites (persist, delay etc)

I have a bunch of Workflow foundation 4.0 RC code activities that consume web services and talk to databases that I want to add some error handling in. I would really like to be able to attempt to call my web service / db, catch any faults such as a communication failure and then retry the same operation in 1 hours time (after I have lo...

WCF Sharing an object between Client and Host

Hey, I can't seem to access the returned value from a method I called on my Host. //Service--------------------------------------------------------- [DataMember] private List<CalculationRecord> History = new List<CalculationRecord>(); public IEnumerable<CalculationRecord> CalculationHistory() { return (IEnum...

Silverlight 4RC threading - can a new Thread return the UI Thread

Hi all, Let's say I have a situation in Silverlight where there is a background thread (guaranteed to NOT be the UI thread) doing some work and it needs to create a new thread. Something like this: //running in a background thread Thread t = new Thread(new ThreadStart(delegate{}); t.Start(); Lets also say that the UI thread at this p...

How to tell whether Code Access Security is allowed in library code

In .NET 4 Code Access Security (CAS) is deprecated. Whenever you call a method that implicitly uses it, it fails with a NotSupportedException, that can be resolved with a configuration switch that makes it fall back to the old behavior. We have a common library that's used in both .NET 3.5 and .NET 4, so we need to be able to tell wheth...

.NET Framework - features in 4.0 that's better than 3.0

Possible Duplicate: What features are people looking forward to in .Net 4.0 - 4.1 Hi folks, i would like to know what is it that motivated you to move to .net 4.0 from earlier frameworks? What specifically could be done better & what was the scenario? TIA ...

CLR 4.0 inlining policy? (maybe bug with MethodImplOptions.NoInlining)

I've testing some new CLR 4.0 behavior in method inlining (cross-assembly inlining) and found some strage results: Assembly ClassLib.dll: using System.Diagnostics; using System; using System.Reflection; using System.Security; using System.Runtime.CompilerServices; namespace ClassLib { public static class A { static readonly Me...

VSTO Development - Key Improvements In VS2010 / .NET 4.0?

Hi all, I am trying to make a case to my bosses on why we should use VS2010 for an upcoming Excel Workbook VSTO application. I haven't used VSTO before but have used VBA. With 2010 just around the corner, I wanted to read about the improvements made to see if it was worth using 2010 to develop this application. So far I have read 2 maj...

Code Contracts: Do we have to specify Contract.Requires(...) statements redundantly in delegating methods?

I'm intending to use the new .NET 4 Code Contracts feature for future development. This made me wonder if we have to specify equivalent Contract.Requires(...) statements redundantly in a chain of methods. I think a code example is worth a thousand words: public bool CrushGodzilla(string weapon, int velocity) { Contract....

Library development - looking for valid use cases for suggested feature

I'm contributing to a library called Fasterflect whose purpose is "improving the developer experience of using reflection". As such, it provides an abstraction built on top of classic reflection and would be used in exactly the same scenarios. The following shows the current syntax for accessing members via an object instance: obj.SetP...

What is the best way get and hold property reference by name in c#

I want to know if there is a better way (than what I'm currently doing) to obtain and hold a reference to a property in another object using only the object and property string names. Particularly, is there a better way to do this with the new dynamic functionality of .Net 4.0? Here is what I have right now. I have a "PropertyReferenc...

Can I use Npgsql Data Provider in my .NET 4.0 project?

I have an MVC project that I would like to write in .NET 4.0 Is it possible to use Npgsql (which currently supports .net 3.5 ) if I will use it through Entity Framework, and I will limit myself to features of EF contained within 3.5? ...