.net-4.0

DLR and reflection

Everywhere I read about the new DLR in .net 4, they say that a good use for it is reflection, and the code snippet always shown is something like dynamic d = GetSomeObject(); d.DoSomething(); d.SomeMember = 1; What does GetSomeObject() look like? I can't find anywhere that explains that. I understand that it can be anything, but in t...

Problem running ASP.NET MVC 2 website on IIS7

I'm trying to deploy my ASP.NET MVC 2 website from VS2010 beta 2 to IIS7. The publish works fine but none of the routes work, so when I go to the URL http://localhost/myapp/Home/Index I get the error: HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavaila...

Receiving NotFound CommunicationException in Sliverlight 3 WCF client

I'm getting a very unhelpful CommunicationException when attempting to call a WCF service from Silverlight 3. The message of the exception is "The remote server returned an error: NotFound." Each inner exception parrots that same message. Is there a problem with my setup that could be causing this issue? Here's my setup. The WCF ser...

System.Web.Extensions Assembly cannot be resolved

I am trying to run a .NET 4.0 Console application that references a sister library project (Bar.dll) which itself references System.Web.Extensions in VS2010 B2. I am currently only interested in getting access to System.Web.Scripting.JavaScriptSerializer. Both projects have references to System.Web.Extensions (using the one listed under...

How to increase concurrent parallel tasks with System.Threading.Parallel (.Net 4.0)

Hi, I'm experimenting with the new System.Threading.Parallel methods like parallel for and foreach. They seem to work nicely but I need a way to increase the number of concurrent threads that are executed which are 8 (I have a Quad core). I know there is a way I just can find the place thy hidden the damn property. Gilad. ...

How to set a principal for a workflowprocess in WF 4.0

Hi, Lately I've run into the following problem. I've started using Workflow 4.0, one of the challenges now is to have the workflow run on the correct user, the one who's actually starting it. In WCF we use a sort of flowing-headers behaviour wich does the trick, but in WF it doesn't work obviously because the workflowhost spawns (almost...

.NET 4.0 Threading.Tasks

I've recently started working on a new application which will utilize task parallelism. I have just begun writing a tasking framework, but have recently seen a number of posts on SO regarding the new System.Threading.Tasks namespace which may be useful to me (and I would rather use an existing framework than roll my own). However lookin...

How do I use a command line tool to install .net 4 to IIS

I'm trying to deploy my WCF RIA services application to our in-house server for testing. I've been following the instructions and comments from this blog site: http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx At the end someone points to this question: http://stackoverflow.com/questions/1528324...

.NET 4.0: How to create an Expression<Func<dynamic, dynamic>> - Or is it a bug?

Hi All, During my work with expression trees for a few days now, I came across something that I find difficult to understand; hopefully someone will be able so shed some light here. If you code Expression<Func<dynamic, dynamic>> expr1 = x => 2 * x; the compiler will complain and you won't get anywhere. However, it seems that if you cre...

Does ASP.NET worker process still return data in chunks of 31kb

Does ASP.NET worker process still return data in chunks of 31Kb This MSDN article written in May 2004 specifies the following. When using the ASP.NET process model, the ASP.NET worker process sends responses back to the client, it first sends them through IIS in 31-kilobyte (KB) chunks. This applies to .NET Framework 1.1,...

Compacting a WeakReference Dictionary

I've got a class Foo with a property Id. My goal is that there are no two instances of Foo with the same Id at the same time. So I created a factory method CreateFoo which uses a cache in order to return the same instance for the same Id. static Foo CreateFoo(int id) { Foo foo; if (!cache.TryGetValue(id, out foo)) { foo...

Validating DataAnnotations with Validator class

I'm trying to validate a class decorated with dataannotation with the Validator class. It works fine when the attributes are applied to the same class. But when I try to use a metadata class it doesn't work. Is there anything I should do with the Validator so it uses the metadata class? Here's some code.. this works: public class Pers...

VS 2010 Setup Project Requires .NET 4.0, but it is already installed

I have a VS 10 project using .Net 4.0 and I use lots of stuff that do require 4.0. I created a VS Setup project added the primary output from my project and built it. I then installed it and everything worked fine. A few days later I am ready to do a new build so I rebuild my project and then the setup project. Now when I run the msi it ...

app.config "forced" (?) on .net 4.0.. is it needed?

It seems that when upgrading a project to .net 4.0 in VS 2010 Beta 2, a app.config file is generated, which roughly looks like this: <?xml version="1.0"?> <configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> Is this file needed in case I want to have a .NET 4.0 only exe...

.NET Dock Panel?

Trying to find a dock panel/window widget like Visual Studio uses for its Toolbox/Properties/Solution Explorer/etc windows. Is there seriously not one already part of the .net framework? Or am I blind? If not, is there one you can recommend for me to download? ...

Expression Trees in .NET 4.0: Expression.Call fails to find method "get_Item" in type List<T>

Hi there, I'm stuck with the problem below and wondering is someone out there will be able to help. I have added comments to the code to make it self-explanatory but let me know if you need more info or if the problem is unclear. Thanks a lot in advance! Edit: I've been asked to summarize the problem in text, so here it goes: under th...

Dynamically adding members to a dynamic object

Hi, I'm looking for a way to add members dynamically to an dynamic object. OK, I guess a little clarification is needed... When you do that : dynamic foo = new ExpandoObject(); foo.Bar = 42; The Bar property will be added dynamically at runtime. But the code still refers "statically" to Bar (the name "Bar" is hard-coded)... What if ...

POCO Support in the Entity Framework

While the application I am developing at the moment is written in .net 4.0 against the beta, I have largely been ignoring POCO support in the Entity Framework because I didn't need it. I'm starting to realize, however, that POCO support would be useful in my project. However, Google searches on POCO in the EF yield a lot of results about...

launch powershell under .NET 4

I am updating a PowerShell script that manages some .NET assemblies. The script was written for assemblies built against .NET 2 (the same version of the framework that PowerShell runs with), but now needs to work with .NET 4 assemblies as well as .NET 2 assemblies. Since .NET 4 supports running applications built against older versions ...

Release Date of .NET 4.0/ VisualStudio 2010

Possible Duplicate: When is .NET 4.0 and Visual Studio 2010 supposed to be released? Possible Duplicate: > When is .NET 4.0 and VS2010 supposed to be released? When are Microsoft going to release .NET 4 and Visual Studio 2010? ...