草庐IT

CLASS_NAME

全部标签

c# - WCF 反序列化中的 XmlException : "Name cannot begin with ' <'" - in automatic property backing fields

我今天开始在WCF反序列化中遇到错误-代码一直没有改变并且工作了几个月。问题是我正在获取运行时XmlException说“名称不能以‘k_BackingField,这是XmlException的来源。我在网上看到了其他一些引用资料,其中人们接受的解决方案是“我更改了我的代码以不使用自动属性”,这对我来说是不能接受的,因为我需要更改100个对象,(其中有1000个属性)。此外,当我上周运行这段相同的代码时,它运行良好,似乎并没有影响所有序列化的DTO,只有一些。更令人沮丧的是,它似乎有点断断续续。今天早上偶尔会抛出异常...!问题;为什么在未更改的代码和未更改的框架源中突然出现此问题?如

c# - Visual Studio express : free class diagram tool

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭8年前。Improvethisquestion我正在使用c#express并希望使用免费工具来设计我的类图。您有什么推荐的免费工具?

C# 验证 : IDataErrorInfo without hard-coded strings of property name?

实现IDataErrorInfo的最佳做法是什么?无论如何都可以在没有属性名称硬编码字符串的情况下实现它? 最佳答案 通用验证例程的基类您可以使用DataAnnotations如果您在IDataErrorInfo实现中做了一些futzing。例如,这是我经常使用的基本View模型(来自Windows窗体,但您可以推断):publicclassViewModelBase:IDataErrorInfo,INotifyPropertyChanged{publiceventPropertyChangedEventHandlerPropert

c# - 通过反射仅获取当前类(class)成员

假设这段代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Reflection;namespaceTestFunctionality{classProgram{staticvoidMain(string[]args){//System.Reflection.Assembly.GetExecutingAssembly().LocationAssemblyassembly=Assembly.LoadF

C#/N 休眠 : Association references unmapped class

几个小时以来,我一直在努力解决这个NHibernate问题。我在网络和NHibernate文档上进行了广泛的研究,但我无法理解这个问题。我对NHibernate比较陌生,但很喜欢它。不过,在那种情况下,它让我发疯。我正在为网站编写一个小型“投票”模块。我有几个类(Poll、PollVote和PollAnswer)。主要的Poll是导致问题的原因。这就是类的样子:publicclassPoll{publicvirtualintId{get;set;}publicvirtualSiteSite{get;set;}publicvirtualstringQuestion{get;set;}pu

c# - cs0030 :Unable to generate a temporary class

我有一个Web服务,当我尝试生成它的对象时出现以下错误。"Unabletogenerateatemporaryclass(result=1).errorCS0030:Cannotconverttype'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment[]'to'ShortSell.ShortSellRQOriginDestinationInformationFlightSegment'errorCS0030:Cannotconverttype'ShortSell.ShortSellRSOriginDestina

c# - "Could not find endpoint element with name..."

抱歉问题陈述太长了...我花了两天时间进行调试并做了很多笔记...我有一个WCF数据服务和另一个试图通过TCP和/或HTTP作为客户端连接到它的进程。我有一个非常简单的测试客户端应用程序,似乎连接正常,但更复杂的生产应用程序无法连接(TCP或HTTP)。在这两个客户端项目中,我让VisualStudio2008使用“添加服务引用”生成app.config,并让它从数据服务中提取元数据。这是工作的简单测试客户端的代码:usingClient.MyDataService;namespaceClient{classProgram{staticvoidMain(string[]args){My

c# - 公共(public)静态字符串 MyFunc() 上的 "Expected class, delegate, enum, interface or struct"错误。什么 's an alternative to "字符串”?

当我尝试使用以下静态函数时出现错误。错误:Expectedclass,delegate,enum,interface,orstruct函数(和类):namespaceMyNamespace{publicclassMyClass{//SomeotherstaticmethodsthatuseClasses,delegates,enums,interfaces,orstructspublicstaticstringMyFunc(stringmyVar){stringmyText=myVar;//DosomestuffwithmyTextandmyVarreturnmyText;}}}这导致

c# - 验证错误 : The value 'on' is not valid for <<property name>>

在我的项目中,我有一个模型,您可以在这里看到我模型的一部分:publicclassCheckoutModel{publicboolOtherPlace{get;set;}[RequiredIf("OtherPlace",true,ErrorMessage="")]publicstringOtherPlaceFullName{get;set;}[RequiredIf("OtherPlace",true,ErrorMessage="")]publicintOtherPlaceProvinceId{get;set;}[RequiredIf("OtherPlace",true,ErrorMes

c# - 无法连接到 FTP : (553) File name not allowed

我需要通过FTP将文件传输到目录。在.Net中,我必须使用目标文件夹中的文件来创建连接,因此我使用FTP手动将Blank.dat放在服务器上。我检查了访问权限(ls-l),它是-rw-r--r--。但是当我尝试连接到FTP文件夹时,我得到:“远程服务器返回错误:(553)文件名不允许”从服务器返回。我所做的研究表明,这可能是由权限问题引起的,但正如我所说,我有权查看该文件并且可以从该文件夹运行ls。还有哪些其他原因可能会导致此问题?是否有一种无需指定文件即可连接到文件夹的方法?byte[]buffer;StreamreqStream;FileStreamstream;FtpWebRes