.net-4.0

How do I set CommandParameter in XAML?

陌路散爱 提交于 2019-12-18 05:18:15
问题 I have the following XAML: <dxg:GridControl Name="theGrid" DataSource="{Binding Path=Groupings}"> <dxg:GridControl.ContextMenu> <ContextMenu> <MenuItem x:Name="gridprint" Command="{Binding Path=GridPrintCommand}"/> </ContextMenu> </dxg:GridControl.ContextMenu> </dxg:GridControl> When GridPrintCommand executes, its parameter to the GridPrintCommand.Execute(param) method is null. I want to set the parameter to the grid control. I can do that in the code-behind like this: gridprint

Unable to resolve assemblies that use Portable Class Libraries

不羁的心 提交于 2019-12-18 04:02:34
问题 I'm having a problem with assembly resolution on an end-user machine and I believe it's related to using Portable Class Libraries.... I have a .NET 4.0 application that was originally written in Visual Studio 2010. Recently we upgraded to Visual Studio 2012 and we've created a few projects that are Portable Class Libraries. I don't believe we need these features now, but we're also building a Windows 8 Store application that might benefit from these libraries. When I compile my project, what

Unable to resolve assemblies that use Portable Class Libraries

蓝咒 提交于 2019-12-18 04:02:06
问题 I'm having a problem with assembly resolution on an end-user machine and I believe it's related to using Portable Class Libraries.... I have a .NET 4.0 application that was originally written in Visual Studio 2010. Recently we upgraded to Visual Studio 2012 and we've created a few projects that are Portable Class Libraries. I don't believe we need these features now, but we're also building a Windows 8 Store application that might benefit from these libraries. When I compile my project, what

Why is ccrewrite.exe not doing anything from the command line?

亡梦爱人 提交于 2019-12-18 03:49:09
问题 I've got Code Contracts working fine from inside Visual Studio 2010, but I can't get ccrewrite.exe to do anything useful from the command line. Here's a sample app: using System.Diagnostics.Contracts; public class Dummy { public static void Main(string[] args) { Contract.Requires(args.Length > 0); } } I then compile the code and run ccrewrite.exe on it: > csc /debug+ /D:CONTRACTS_FULL Dummy.cs > ccrewrite /o:RewrittenDummy.exe Dummy.exe elapsed time: 61ms There's no RewrittenDummy.exe file

Can't get the new 2009 XAML primitives working, why?

一曲冷凌霜 提交于 2019-12-18 03:34:31
问题 What I'd like to use: 2009 XAML primitives How it would be nice to use them: <sapv:ExpressionTextBox xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ExpressionType="x:String" /> What actually happens: "Type reference cannot find the public type named String" The examples I see don't have updated namespaces. I tried 2009 and 2010, but to no avail. This is in VS 2010 RTM. What am I doing wrong? 回答1: I believe the key sentence on the documentation page is this: In WPF, you can use XAML

Entity Framework 5 on .NET 4.0 - DatabaseGeneratedOption.Identity is undefined

风格不统一 提交于 2019-12-18 03:20:30
问题 I need to use EF5 on .NET 4 and I've run into a reference issue when mapping my class with HasDatabaseGenerationOption.Identity which doesn't exist in the 4.0 version of the library. The following is failing: this.Property(t => t.DeploymentLogId) .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); Does anyone know of a work around? 回答1: Using NuGet to add EntityFramework to a project that targets .NET 4.5, will add EntityFramework 5.0. If you later change the project to target .NET

Entity Framework 5 on .NET 4.0 - DatabaseGeneratedOption.Identity is undefined

浪尽此生 提交于 2019-12-18 03:20:05
问题 I need to use EF5 on .NET 4 and I've run into a reference issue when mapping my class with HasDatabaseGenerationOption.Identity which doesn't exist in the 4.0 version of the library. The following is failing: this.Property(t => t.DeploymentLogId) .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); Does anyone know of a work around? 回答1: Using NuGet to add EntityFramework to a project that targets .NET 4.5, will add EntityFramework 5.0. If you later change the project to target .NET

WPF Application still runs in background after closing

为君一笑 提交于 2019-12-18 01:38:27
问题 This is slightly related to the question asked here yet the answer does not apply to my case as I am not using threads: WPF Not closing properly I have converted one of my WinForm application to a WPF application, nothing drastic needed to be done except for change a few words to the WPF/C# 4.0 equivalents (MessageBoxButtons to MessageBoxButton, why the one letter difference?). Anyway, if I run the application through the debugger it runs fine until I come to close it with the "X" button to

Consuming REST Web Service in .NET MVC 3

你说的曾经没有我的故事 提交于 2019-12-17 23:13:25
问题 I am working on a .NET 4 MVC 3 application. I'm trying to follow a domain driven design paradigm. Right now, my application is broken into two pieces, a domain and my MVC code for the web. I'd like some help in determining where in this structure I should consume a RESTful web service. This specific project uses a RESTful web service to retrieve and persist data. In my domain, I have two entities "Customer" and "User" which pair up with web services of the same name. e.g. URL/Customer and URL

Difference between background and concurrent garbage collection?

北城余情 提交于 2019-12-17 21:53:38
问题 I read that with .NET Framework 4 the current garbage collection implementation is replaced: The .NET Framework 4 provides background garbage collection. This feature replaces concurrent garbage collection in previous versions and provides better performance. At this page there is an explanation how it works but I am not sure I understood it. In practical world application what is the benefit of this new GC implementation? Is it a feature that could be use to push for a transition from 3.5 or