.net-4.0

LinkBuilder.BuildUrlFromExpression not working anymore in .Net 4 / VS 2010 ?

Hi, I recently migrating my ASP.Net MVC 1 application from VS.Net 2008 / C# 3.5 to VS.NET 2010 / C# 4.0. I massively used a builder to get URL strings from the strongly typed calls. It looks like this : // sample call : string toSamplePage = Url.To<SampleController>(c => c.Page(parameter1, parameter2)); the code is added as an exten...

Which C# mocking framework takes best advantage of .NET 4?

I would assume that the more dynamic nature of .NET 4 would improve the possibility of mocking. (but I may be wrong) Are there mocking frameworks that take advantage of .NET 4? If yes, which does it best? Conversely, are there mocking frameworks that do not even run on .NET 4? ...

Question on using .NET 4.0 Client bindings in Web forms app

I have a requirement in which there is a list of records on a page. When a user clicks on one of the individual items, a modal popup would display the details along with the ability to make changes and save. The way I envision this would be developed is to have the markup on the list page but keep it hidden. When a user clicks on one of...

How do I add custom properties to a Word doc with .NET 4?

Using .NET 4, how do I add custom properties to a document? I'm assuming it goes something like this: WordApp // an instance of Microsoft.Office.Interop.Word.Application .ActiveDocument .CustomDocumentProperties .Add...? I cannot seem to find documentation for this that applies to .NET4/interops v14. ...

.NET 4.0 Memory Mapped Files Performance

I'd like to know if anyone tried new .NET 4.0 Memory Mapped Files features? I know that they are as old as OS but native handling in .NET is new. Has anyone been able to test this and say something about performance? I'm quite interested in access time to random parts of binary file, write speed and so on. Also performance comparsion ...

How do I Emit a System.Linq.Expression?

I've got some code that generates various Func<> delegates using System.Linq.Expressions and Expression.Lambda<Func<>>.Compile() etc. I would like to be able to serialize the generated functions into an assembly for later use. In the past I've done some stuff with System.Reflection.Emit but now that Linq Expressions I'd rather not go tha...

What's new in .net 4 for MVVM?

Does .net 4 add anything new for working with MVVM? ...

Setting up the root url in IIS7 for asp.net mvc 2

I have a bit of a strange question. I'm building a multi tenant website with Asp.net MVC 2 and running it on IIS7. I'm trying to get my dev environment setup properly for testing but I'm having a weird issue though. I created the website in IIS and pointed the directory to the location of my source code. I have just the basic HomeContr...

Nant msbuild task with .net 4.0 rc

How do I need to indicate to the msbuild task in my nant script that it should use .net 4.0 rc? ...

Why does Visual Studio 2010 have .NET Framework 4.0 Client Profile as default project type?

Client profile mode is the subset of Full .NET Framework and it eliminates the designer related assemblies which are unnecessary for the end user deployment and etc. Everything looks great and it really helps us to solve the deployment huge data transfer problem. But what is the need of Client profile project type as the default one? I ...

Why do 'requires' statements fail when loading (iron)ruby script via a C# program?

IronRuby and VS2010 noob question: I'm trying to do a spike to test the feasibility of interop between a C# project and an existing RubyGem rather than re-invent that particular wheel in .net. I've downloaded and installed IronRuby and the RubyGems package, as well as the gem I'd ultimately like to use. Running .rb files or working i...

.NET 4 - Determine the number of touch points available in Win 7

Windows 7 reports the number of touch points available to the system under the computer properties - is there a way to get that info in .NET 4? ...

Patterns for delegating work to multiple threads

I'm updating a WinForms application that uses a BackgroundWorker to do something useful when a button is pressed. The trouble is, "something useful" iterates sequentially through a long list of things to do, and can take quite a while to complete. I'm considering having the button press event create multiple BackgroundWorkers instead o...

How do I do a "like" wildcard comparison in Entity Framework in .NET 4.0?

I'm using the Visual Studio 2010 RC for .NET 4.0 and I'm trying to figure out how to do a wildcard comparison with Entity Framework. I'd like to have the following query for EF where I find all the names that start with 'J' select * from Users where FirstName like 'J%' ...

Can I use a .NET 4.0 library in a .NET 2.0 application?

I'm running into some problems using my .NET 4.0 libraries in .NET 2.0 applications. I guess I was under the impression that being a Windows DLL, my other .NET apps would be able to access it. Is this not the case? Any recommendations in terms of supporting applications in both environments? EDIT: I realize that I'd need to install t...

Problem using SqlServerCe in .Net 4.0

SqlServerCe doesn't seem be supported in .net 4.0. But since I needed an embedded database in my application, I gathered all the necessary 3.5 dlls and included them so that my wpf application could use SqlServerCe as its embedded database. The application works on my development machine, but now that I've created an installer, and am i...

What happened to the .NET version definition with v4.0?

I'm building a C# class library, and using the beta 2 of Visual Web Developer/Visual C# 2010. I'm trying to save information about what version of .NET the library was built under. In the past, I was able to use this: // What version of .net was it built under? #if NET_1_0 public const string NETFrameworkVersion = ".NET 1.0"; ...

Entity Framework Vote of No Confidence - relevant in .NET 4?

Hi, I'm deciding on an ORM for a big project and was determined to go for ADO.NET Entity Framework, specifically its new version that ships with .NET 4. During my search for information on EF I stumbled upon ADO .NET Entity Framework Vote of No Confidence which I'm not sure how to take. The Vote of No Confidence was written sometime in...

Why is the new Tuple type in .Net 4.0 a reference type (class) and not a value type (struct)

Does anyone know the answer and/or have an oppinion about it? Since tuples would normally not be very large I would assume it would make more sense to use structs than classes for these. What say you? ...

Should I use Url.Content() or ResolveUrl() in my MVC views?

When building code like this: <script type="text/javascript" src="<%=ResolveUrl("~/js/js.js")%>"></script> or <input type="image" src="<%=ResolveUrl("~/img/submit.png")%>" /> Should I use Url.Content or ResolveUrl()? What's the difference? ...