.net-4.0

Deserialization of Json without name fields

非 Y 不嫁゛ 提交于 2019-12-11 07:38:01
问题 I need to deserialize the following Json, which according to Jsonlint.com is valid, but ive not come across this before or cannot find examples of similar Json and how to deal with it? [1,"Bellegrove / Sherwood ","76705","486","Bexleyheath Ctr",1354565507000] My current system with like this: Data class: [DataContract] public class TFLCollection { [DataMember(Name = "arrivals")] public IEnumerable<TFLB> TFLB { get; set; } } [DataContract] public class TFLB { [DataMember] public string

How ISubject and Subject will look like in this sample and are the sample using them in the right place?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 07:23:38
问题 I got this sample http://jfromaniello.blogspot.com/2010/04/event-aggregator-with-reactive.html, Which describe event aggregator pattern using .net 4.0 but i didn't find in the sample code the ISubject interface and the Subject class and i found the he is using them in the EventAggregator class, is it right to use them like that and what will their code will look like? 回答1: I'm not 100% sure what you are asking here - are you just looking for the ISubject interface and implementation? If so

NServiceBus fails to process message: The requested service 'NServiceBus.Impersonation.ExtractIncomingPrincipal' has not been registered

烈酒焚心 提交于 2019-12-11 07:19:04
问题 I am receiving an error when using NServiceBus 4.0.3 with NHibernate 3.3.1 when it's trying to process a message INFO NServiceBus.Unicast.Transport.TransportReceiver [(null)] <(null)> - Failed to process message Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'NServiceBus.Impersonation.ExtractIncomingPrincipal' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered

WCF WebService with Spring.NET could not find base address scheme http

风格不统一 提交于 2019-12-11 07:13:35
问题 I search the entire internet to solve this problem and although I found very similar problems, none of them were my own. Here's the deal: I want to configure a WCF Web Service (.Net 4.0 and VS 2010) with Spring.NET 1.3.1. for Dependence Injection. I'm using IIS 7 now (but I probably need to set it up for a different IIS later). I'm NOT configuring this to run with HTTPS (I'll probably want in the future, but that's not the case right now). I first configured the WCF Web Service without Spring

Does the following generic method already exist in the .NET 4.0 framework?

二次信任 提交于 2019-12-11 07:07:43
问题 Does the following generic function exist anywhere in the .NET 4.0 framework? I would like to reuse it if it does rather than writing it myself: public static class Lambda { public static U Wrap<U>(Func<U> f) { return f(); } } It allows for the following construct (i.e., lambda expressions embedded in the select clause of a LINQ query): string test="12,23,34,23,12"; var res=from string s in test.Split(',') select Lambda.Wrap(() => {string u=s+s; return int.Parse(u);}); Update: To all people

Autofac + WCF REST 4.0

旧城冷巷雨未停 提交于 2019-12-11 06:51:30
问题 I am building a WCF 4.0 REST service and want to use Autofac as DI container. Apparently, I want to be able to call a parameterized constructor of the service class (service contract implementation), which accepts a bunch of interfaces to work with. Those interfaces are to be registered within Autofac container and I want them resolved and used when creating an instance of my service class (instead of calling not parameterized constructor, which is default). There is similar problem with MVC

How to add rows and columns to a DataGrid?

孤人 提交于 2019-12-11 06:23:32
问题 how is it possible to add rows and columns to a DataGrid? I am trying to write two functions like: public void addRow(DataGrid grid); public void addColumn(DataGrid grid); Unfortunately the DataGrid itself doesn't have those functions by default. Thanks a lot. 回答1: I haven't done lots with DataGrid's lately, but for as far I know, a DataGrid has a datasource, and it's the datasource that should be extended within the code. After extending the datasource (like a datatable), you should refresh

Remove original event behaviour of WinForm Control

心已入冬 提交于 2019-12-11 06:17:13
问题 I would like to remove the original event behavior of controls within a form (similar to design mode). So, when the user clicks on the button, i only want to capture that event. I do not want the original button event to be fired. Is this somehow possible? I am looking for a generic solution. So it should work with any form and any control within the form. Reason: I wrote a form validation rules designer. It uses reflection to enumerate all form-types in the entry assembly. The user can then

ITestCaseResult.Iterations.Count returns 0 for a test with iterations

白昼怎懂夜的黑 提交于 2019-12-11 05:52:53
问题 I have a couple of simple web tests that use data sources. Each web test contains only one request. After they run it's pretty hard to detect why they failed, given that they are quite a few (80) and each has a number of rows that varies between 1 and 150. Therefore, I used the TFS SDK to access the results programmatically, after publishing the test results to a build in TFS. Here is the relevant part of the code: foreach (var testRun in testRuns) { Console.WriteLine(string.Format("{0}",

pInvoke, .net 4 vs 3.5

一曲冷凌霜 提交于 2019-12-11 05:48:39
问题 I've an issue regarding p/invoke from managed to unmanaged code. See my original post at the MSDN forum (as brief summary is seen later in this post). Before I go on, I just want to explain a couple of things: I have a wrapper assembly in net 3.5 that does the actual interop to the unmanaged code. Then I have my console "host app" which uses the wrapper assembly. The solution I came up (I refer to my MSDN post) works when the host app is using .net 4, but it doesn't work when changing the