.net-4.0

Issue with x:TypeArguments and generic List class in XAML

风格不统一 提交于 2020-01-02 02:21:14
问题 I created the following markup for a loose XAML file. <StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"> <scg:List x:TypeArguments="sys:String"> HelloWorld </scg:List> </StackPanel> But I get this error when I run the loose XAML in IE: The tag 'List' does not exist in XML namespace 'clr

Issue with x:TypeArguments and generic List class in XAML

僤鯓⒐⒋嵵緔 提交于 2020-01-02 02:21:05
问题 I created the following markup for a loose XAML file. <StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"> <scg:List x:TypeArguments="sys:String"> HelloWorld </scg:List> </StackPanel> But I get this error when I run the loose XAML in IE: The tag 'List' does not exist in XML namespace 'clr

First call to a .net webservice is slow

*爱你&永不变心* 提交于 2020-01-02 01:56:26
问题 I'm calling a .net webservice from my .net winforms app, both in framework 4.0. During the execution of the program, the first time the webservice has a method called, the call takes ~10-12 seconds. Subsequent calls take ~1-2 seconds. Subsequent calls, even when the web reference instance is recreated, are still ~1-2 seconds. When the winforms app is restarted, the first call delay occurs again, but subsequent calls are responsive. The instance of the web reference is being created prior to

Can I develop asp.net 3.5/2.0 projects using Visual Studio 2010?

旧巷老猫 提交于 2020-01-02 00:49:20
问题 Can I develop asp.net 3.5/2.0 projects using Visual Studio 2010? Or I will be stick on .Net Framework 4.0? 回答1: From MSDN VS 2010 The multi-targeting feature of Visual Studio lets you specify the version of the .NET Framework, or its profile, that is required for your application. The key benefit of multi-targeting is that you can use the current version of Visual Studio to create and develop projects that target earlier versions of the .NET Framework. For example, you can continue to develop

Access the voting buttons extended property through Exchange Web Services

谁都会走 提交于 2020-01-01 19:45:09
问题 I'm using the Exchange Web Services (Exchange server 2007) to try to send an email with voting buttons in. I read this question/answer: Send Voting Email I have had a colleague using Outlook 2007 send me an email with simple yes/no voting buttons (the buttons display in Outlook, I have not sent an answer) and I can confirm that it is the first email in my Inbox. I've then used the EWS to get that email and try to get the extended properties relating to the email, so I can get the binary

'foreach' failing when using Parallel Task Library

大兔子大兔子 提交于 2020-01-01 18:59:25
问题 The following code creates the correct number of files, but every file contains the contents of the first list. Can anyone spot what I've done wrong please? private IList<List<string>> GetLists() { // Code omitted for brevity... } private void DoSomethingInParallel() { var lists = GetLists(); var tasks = new List<Task>(); var factory = new TaskFactory(); foreach (var list in lists) { tasks.Add(factory.StartNew(() => { WriteListToLogFile(list); })); } Task.WaitAll(tasks.ToArray()); } 回答1: The

log4net and .net Framework 4.0

谁说我不能喝 提交于 2020-01-01 16:10:11
问题 I was having issues in log4net when I updated my solutions to .net 4.0 , and then I downloaded the source of it and built log4net and targeted it to .net 4.0 and used it in my projects. Initially when I referred log4net that is targeted to run time 2.0 it complied and run the application but log did not work. Now when I run my project with log4net targeted to .net 4.0 I get the error "The type initializer for 'Log4NetTest.TestLog' threw an exception." Any Idea how to solve this? Edit: this is

Entity Framework POCO objects

一笑奈何 提交于 2020-01-01 15:00:09
问题 I'm struggling with understanding Entity Framework and POCO objects. Here's what I'm trying to achieve. 1) Separate the DAL from the Business Layer by having my business layer use an interface to my DAL. Maybe use Unity to create my context. 2) Use Entity Framework inside my DAL. I have a Domain model with objects that reside in my business layer. I also have a database full of tables that doesn't really represent my domain model. I setup Entity Framework and generated POCO objects by using

Left outer join and group by

 ̄綄美尐妖づ 提交于 2020-01-01 12:12:32
问题 I have the following class definition: public class MyData { public DateTime Expiration { get; private set; } public string Name { get; private set; } public double Price { get; private set; } public double Quantity { get; private set; } } I need to join this with a list of years: IEnumerable<int> years= Enumerable.Range(1, 20); The result will be ultimately be displayed in a grid with the y-axis representing the Name field and the x-axis representing the years. Each cell will be the

Is it possible to inject an existing instance into a MEF plugin?

拥有回忆 提交于 2020-01-01 12:08:07
问题 We are creating an application which supports plugins using MEF. We are determining what type of plugins the user is able to create, and want to use dependency injection to provide this type of plugin with the data it needs. For example, we make a plugin that is able to display a list. To achieve this, it needs the existing instance of the IRepository for the type of data the list will display. The IRepository is created somewhere else in a datacontext class, so we are unable to let MEF