.net-4.0

C# 4.0: Why MethodBag when there's ExpandoObject?

I don't understand, why use dynamic MethodBags when I can use ExpandoObject? What am I missing here? ...

Entity Framework 4 Multiple Object Delete(RemoveAll)

I read that the new Entity Framework will include a method to delete multiple items (Linq to SQL has DeleteAllOnSubmit()) but I can't find the function/method to do that. Is this in Beta 2 or do I have to make my own? UPDATE: This is what I'm using now: public void DeleteObjects(IEnumerable<object> objects) { foreach ...

Using custom Data Service Providers, do I have any control over URLs that are returned?

I'm implementing several custom Data Service Providers in WCF Data Services: IDataServiceMetadataProvider IDataServiceQueryProvider IDataServiceUpdateProvider To illustrate the point of my question consider this made-up example: I have a resource called "Employee," which can be addressed in the following ways: MyDataService.svc/Em...

Call between ambigious RenderActions

I recently uploaded my ASP.NET MVC 2 Preview 2/.NET 4 application (Built using VS 2010 Beta 2) to MaximumASP.com's beta websites and when I try to run it I get the following error: CS0121: The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.ChildActionExtensions.RenderAction(System.Web.Mvc.HtmlHelp...

c# Layout problems with WF Subelements

Hi there, i have another layout problem. I have a WorkflowElement which contains other Workflow Elements: one fixed subelement and on the right side a horizontal List of subelements here goes my XAML Code: <Grid Grid.Column="0" Name="defaultGrid" > <Rectangle Grid.Column="0" Grid.Row="0" Width="2" HorizontalAlignment="Ce...

Developing Azure .Net 4.0 Applications

Presently .Net 4.0 is not supported on Azure. This thread indicates that you will not be able to use .Net 4.0 with VS 2010 until it is supported in the cloud. http://social.msdn.microsoft.com I'd like a way to start developing Azure applications locally utilizing the new features of .Net 4.0. I am fine with not being able to deploy th...

ASP.NET MVC 2 Preview/Beta Visual Studio Questions

ASP.NET MVC 2 Beta was just released and I'm a bit confused as to what is required to run it. Does it require .NET 4? If I have an App that was created using Visual Studio 2010 Beta 2, can I port it to ASP.NET MVC 2 Beta by referencing the proper DLLs? If so what DLLs do I need? Can I run ASP.NET MVC Beta 2 on .NET 4 ready hosting ser...

Error : "Unable to start debugging on the web server..." ASP.NET 4.0

Hi, I am getting an error when I want to create a web site on IIS server. I am using Windows 7 and Visual Studio 2010. Do I have to register or configure asp.net 4.0 for the IIS ? ...

Is it possible install .net 4.0 on windows 2003 with iis6 ?

Hi, Is it possible install .net 4.0 on windows 2003 with iis6 ? is there some how to ? Tanks Mirko ...

Is PIA embedding broken in .NET 4.0 beta 2?

A while ago, I wrote some Word interop examples in Visual Studio beta 1, and set the reference to Microsoft.Office.Interop.Word to be embedded (set the "Embed Interop Types" = true in the reference properties). These worked fine, and I haven't run them for a while... until today. Of course, now I'm running under beta 2 of both Visual St...

.net 4 ws-discovery endpoints

Hi, I am using ws-discovery in .NET 4.0 and it is working well. One question I have is how to deal with services that are not working. For example, say I have IService on server A and server B. Let's say this service on server A is broken (mimic this by stopping Application Pool). Your client will still find 2 services, so when you atte...

How do I express a void method call as the result of DynamicMetaObject.BindInvokeMember?

I'm trying to give a short example of IDynamicMetaObjectProvider for the second edition of C# in Depth, and I'm running into issues. I want to be able to express a void call, and I'm failing. I'm sure it's possible, because if I dynamically call a void method using the reflection binder, all is fine. Here's a short but complete example:...

Areas over multiple projects - Views not found in child projects

I've been following this guide from MSDN about "Creating an ASP.NET MVC Areas Application Using Multiple Projects". Since ASP.NET MVC 2.0 is just preview one would imagine there to be some bugs. My problem is, it simply doesn't work! At least not the way it's suppose to. After setting everything up and pressing F5, one would think that,...

What type should I use for saving images using C#?

I have this class called Hero that has the following attributes. String is for letters, int for numbers, etc. What can I use if I'm going to be saving an image there? public class Hero { [Hero class's attributes (non-image related] public byte[] Portrait { get; set; } public byte[] Screenshot { get; set; } } Portrait and S...

WinForm application doesn't start outside Visual Studio 2010

I have a WinForm application written with VS2008 and .NET 3.5. This application runs well from Visual Studio 2008 and outside (when VS2008 is closed, simple double-click on the EXE boots the application). I decided this morning to migrate everything to VS2010 and .NET 4 (updated the target framework). Everything compiles and the applic...

Upgrading from .NET 3.5 to 4. Questions to think about?

Curious about things to consider to avoid any code breaks, etc to upgrade from .NET 3.5 to 4. I am particularly interested in: - What would be the server requirements to deploy a .NET 4 app? Does it need any particular version of IIS and Windows Server to run? I am facing serious performance issues with Entity Framework due to the larg...

.NET 4 makes for better unit testing/mocking due to the ability to monkey patch?

Consider this about the up-coming Iron Python implementation. In theory it would allow monkey patching right? Good or bad, it matters not. Given someone else's non-testable code (at least easily) the dynamic keyword would allow monkey patching would it not? This has great potential for C# and VB if I'm reading it right. What are the th...

Does .NET 4 Parallel Extensions include an implementation of a lock-free Producer/Consumer queue?

Does .NET 4 Parallel Extensions include an implementation of a lock-free Producer/Consumer queue? Is there any class or interface to implement which could help me to implement this pattern correctly? Thanks! ...

How to do server side pre filtering with Entity Framework and Dynamic Data?

I use Entity Framework 4.0 and need to prefilter all queries using TennantId. I modified T4 template to add pre-filter to all ObjectSets like so and it works for "regular" part of the application. public ObjectSet<Category> Categories { get { if ((_Categories == null)) { _Categories = base.CreateObjec...

What versions of Windows will .Net 4.0 support?

What versions of Windows is Microsoft planning to support with .NET 4.0? ...