Return Json object with Duplicate Keys using C#

I'm using WEB API to receive the request from the Client application to save the Contact Information and I need to send the Error Message only if data has an error otherwise nothing TODO Early I Used Dictionary For Example: Dictionary<string, string> error = new Dictionary<string, string> { {"SaveContactMethod_1", "FirstName Invalid"}, {"SaveContactMethod_2", "LastNam

使用C#返回带有重复键的Json对象

我正在使用WEB API接收来自客户端应用程序的请求以保存联系信息,并且只有在数据有错误时我才需要发送错误消息,否则就没有任何问题 早期我使用过的词典 例如: Dictionary<string, string> error = new Dictionary<string, string> { {"SaveContactMethod_1", "FirstName Invalid"}, {"SaveContactMethod_2", "LastName Invalid"}, {"SaveContactMethod_3", "MiddleName Invalid"}, } 相应的JSON

Find all dependencies of a single class

How do I automatically get a list of dependencies of a single .NET (C#) class with direct and indirect dependencies but excluding classes from 3rd party libraries? I've tried VS and NDepend. With VS's Generate dependency graph it doesn't allow to pick a single class and I get a huge unmanageable graph with NDepend it includes dependencies from 3rd party libraries and I've not f

查找单个类的所有依赖关系

如何自动获取具有直接和间接依赖关系的单个.NET(C#)类的依赖项列表,但不包括来自第三方库的类? 我试过VS和NDepend。 使用VS的生成依赖关系图,它不允许选择一个类,并且我使用NDepend获得了一个巨大的难以管理的图,它包含了来自第三方库的依赖关系,我还没有找到排除这些依赖关系的选项,并将它保留在类级别上迫使我切换到名称空间或组装级别。 您可以使用Visual Studio Enterprise来完成此操作。 从Architecture菜

exclude assembly in some ways but not others

I'm using NDepend to analyze a C# project that I'm in the middle of developing. I have most of my business logic and data access layers written, but right now, the only front end application that I have is a "quick and dirty" test application. So first off, NDepend has all kinds of issues with my test application. Nothing serious, just things like too many methods, too-long

排除大会在某些方面,但不是其他人

我使用NDepend来分析正处于开发阶段的C#项目。 我编写了大部分业务逻辑和数据访问层,但现在,我拥有的唯一前端应用程序是“快速和肮脏”的测试应用程序。 因此,首先,NDepend对我的测试应用程序有各种问题。 没有什么严重的,只是像太多的方法,太长的方法等等。由于这基本上是一次性应用程序,我不想花费大量时间来重构它,所以我从NDepend项目中删除了它。 问题是,现在,因为这是在项目我唯一的前端应用,NDepend的抱

how to connect the dots?

Please, observe the following trivial program using MEF as the Dependency Injection framework: using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; namespace ConsoleApplication2 { [InheritedExport] public interface ITest { void DoSomething(); } [PartCreationPolicy(CreationPolicy.NonShared)] public class Test : ITest {

如何连接点?

请观察使用MEF作为依赖注入框架的以下简单程序: using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; namespace ConsoleApplication2 { [InheritedExport] public interface ITest { void DoSomething(); } [PartCreationPolicy(CreationPolicy.NonShared)] public class Test : ITest { #region Implementation of ITest pub

How do I programatically create an NDepend project file?

To start, this may be a useful link: http://www.ndepend.com/NDependConsole.aspx As anyone who has used Visual NDepend may know, with NDepends you need to import project / solution files, and the corresponding output directories, namespaces, and assemblies are added to the NDepends project. The problem I have, is I have TONS of these projects and solutions to add. It seems ridiculous to sit t

如何以编程方式创建NDepend项目文件?

首先,这可能是一个有用的链接:http://www.ndepend.com/NDependConsole.aspx 因为任何使用Visual NDepend的人都知道,使用NDepends你需要导入项目/解决方案文件,并且相应的输出目录,名称空间和程序集被添加到NDepends项目中。 我遇到的问题是,我有这些项目和解决方案的补充。 坐在那里45分钟似乎荒谬的点击点击添加300个解决方案。 必须有一种方法可以从这些解决方案/项目文件的路径列表中创建NDepend项目文件。 我

System.UnauthorizedAccessException

We have two issues, which we think may be related with the NDependAPI Firstly, the IIS worker process in which the program we're writing uses the NDepend API, runs on 4Gb+ of memory when the first request hits, and it goes up by around ~100-400mb every subsequent request. Secondly, any requests after our first one result in the generation of a large number of System.UnauthorizedAccessExce

System.UnauthorizedAccessException的

我们有两个问题,我们认为这可能与NDependAPI有关 首先,我们正在编写程序的IIS工作进程使用NDepend API,在第一次请求命中时运行在4Gb +内存上,每接下来的请求就会增加约100-400mb。 其次,第一个请求之后的任何请求都会导致产生大量System.UnauthorizedAccessExceptions到文件,这些文件的名称类似于CQLinqAsm_[GUID].dll 看着C: WINDOWS TEMP ,有一堆文件,比如wz1p0cca.out或ws1ju0z0.err等。 打开文件,他们也

NDepend TypeInitializationExceptions when Testing with NUnit

So I'm trying to set up a project using the NDepend API for some metrics on my code (Which works nicely), however, when I attempt to run a testing framework (NUnit) over it, I'm getting TypeInitializationExceptions thrown. Here is some code to reproduce the errors I'm getting: Create a class library project, and reference the NDepend API dll at $NDependInstallPath$libNDependAPI ,

使用NUnit进行测试时,NDepend TypeInitializationExceptions

所以我试图使用NDepend API来设置一个项目,用于我的代码的某些指标(这很好地工作),但是,当我试图运行测试框架(NUnit)时,我得到了TypeInitializationExceptions。 这里是一些代码来重现我得到的错误: 创建一个类库项目,并引用$NDependInstallPath$libNDependAPI的NDepend API dll,将copy local设置为false 。 创建一个类如下: public class NDependProjectLoader { public void LoadAnNDependProject() {

How do I automatically fail a nant build if NDepend query raises a warning

OK first some background. I am busy automating our build process. We run a mixture of Vs 2005 and VS 2008 both targeting platform 2.0. We use Nant to do our builds using the MSBUILD task to do the compile and Cruise Control .net to do our CI. Currently we treat all warnings as errors, fail the build if any FxCop rules fail (except a small subset that we disabled), fail the build if Simian det

如果NDepend查询引发警告,我该如何自动失败

首先确定一些背景。 我正忙于自动构建过程。 我们将Vs 2005和VS 2008混合使用,都针对平台2.0。 我们使用南特做我们的构建使用MSBUILD任务做编译和巡航控制.net来做我们的CI。 目前,我们将所有警告视为错误,如果任何FxCop规则失败(除了我们禁用的小子集),则构建失败,如果Simian检测到所有项目中超过5行的代码重复,则构建失败。 我编写了NDepend CQL查询来强制执行一些难以在FxCop中实现的规则。 如果某个方法/类中

Get DLL or EXE dependencies, using NDepend

I need to get the list of referenced assemblies used in EXE or DLL file. I was looking NDepend as an option to do it through its console so I can have a programatically solution for this. As far as I know, NDepend reads dependencies from a Visual Studio project, but I don't know if it's possible to tell NDepend to analize a DLL and reads its referenced assemblies. Anyone knows if it&

使用NDepend获取DLL或EXE依赖关系

我需要获取EXE或DLL文件中使用的引用程序集列表。 我正在寻找NDepend作为通过它的控制台执行它的一个选项,所以我可以通过编程方式解决这个问题。 据我所知,NDepend从Visual Studio项目读取依赖项,但我不知道是否可以告诉NDepend分析DLL并读取其引用的程序集。 任何人都知道是否可以用NDepend来做到这一点? 如果没有,我可以使用另一种工具或机制来实现这个目标? 谢谢,让我知道你是否需要任何额外的细节。 使用Re

WRN: Assembly binding logging is turned OFF

I encountered this error, WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog]. And once I got into th

警告:程序集绑定日志记录已关闭

我遇到这个错误, 警告:程序集绑定日志记录已关闭。 要启用程序集绑定失败日志记录,请将注册表值[HKLM Software Microsoft Fusion!EnableLog](DWORD)设置为1。 注意:与汇编绑定失败日志记录相关的性能损失。 要关闭此功能,请删除注册表值[HKLM Software Microsoft Fusion!EnableLog]。 一旦我进入融合文件夹,我找不到EnableLog文件,你能帮我吗? 如果您希望诊断加载程序集的问题,则只需要打开程序集