Tag: .net 4.5

为什么IPAddress.Parse(“192.168.001.001”)有效,而IPAddress.Parse(“192.168.001.009”)没有?

我试图从API结果中解析IP地址,其中IPv4地址的四个中心中的每一个都以0(零)为前缀。 像这样的东西: 127.000.000.001而不是127.0.0.1 我在尝试解析192.168.001.009时开始出现解析错误。 它也失败了192.168.001.008,但适用于007,006,005到001! 它也失败了192.168.001.018,但适用于.017,.016降至010! 它适用于192.168.001.8或.8以及192.168.001.18和.19 …… 这是CLR中的错误吗? 或者我错过了一些愚蠢的东西? 试一试: IPAddress.Parse(“192.168.001.007”); // works IPAddress.Parse(“192.168.001.87”); // works IPAddress.Parse(“192.168.001.008”); // throws exception IPAddress.Parse(“192.168.001.19”); // works IPAddress.Parse(“192.168.001.019”); // throws exception // and so on!

为什么我的class级不符合CLS?

这真让我感到困惑。 我已经尝试删除只读,更改名称..我在这里做错了什么? public abstract class CatalogBase where T : class { protected readonly String DataPath; protected readonly XmlSerializer Serializer; private readonly XmlSerializerNamespaces _namespaces; protected CatalogBase(String dataPath) { DataPath = dataPath; Serializer = new XmlSerializer(typeof (T)); _namespaces = new XmlSerializerNamespaces(); _namespaces.Add(String.Empty, String.Empty); } public virtual void Write(T obj) { var streamWriter = new StreamWriter(DataPath); Serializer.Serialize(streamWriter, obj, […]

Visual Studio 2012 – 在.NET 4.5框架中找不到System.Transactions程序集

我正在尝试在C#Visual Studio 2012项目中添加对System.Transactions的引用,但System.Transactions在框架程序集中不可用,您可以在下面的屏幕截图中看到它们: 有谁知道为什么System.Transactions对我不可用? 我怎样才能重新出现? 编辑:修复了截图,谢谢Marc!

EF5不会创建枚举列

我有这样的模型: namespace Ad.NegCred.Data.Model { public enum DataKind { F, //Takibe alınıp henüz tahsil edilmeyen ferdi kredi bildirimi FA, //Aynı dönemde takibe alınan ve tahsil edilen ferdi kredi bildirimi FF, //daha önceki dönemlerde takibe alındığı bildirilmiş ferdi kredi tahsil bildirimi K, //Takibe alınıp henüz tahsil edilmeyan kredi kartı KA, //Aynı dönemde takibe alınan ve tahsil edilen […]

如何防止回到上一页

对于我正在开发的Windows Phone 8应用程序,我必须在应用程序启动时加载一些数据。 为此,我设计了一个名为SplashScreen.xaml的页面来加载数据,在完成所有加载后,我使用以下方法导航到MainPage.xaml : NavigationService.Navigate(new Uri(“/MainPage.xaml”, UriKind.Relative)); 现在,当用户在主页面并点击手机上的后退按钮而不是退出应用程序(这是默认手势)时,回到SplashScreen.xaml ,使他们无法退出应用程序(除了用于点击将应用程序带到背景的开始按钮,当然给他们留下了不好的印象。 问题是如何防止回到上一页谢谢大家。

如何在WPF 4.5中为按钮单击事件创建MarkupExtenstion?

我想创建MarkupExtension以支持Button click事件。 我在这里有一篇关于PreviewKeyDown的文章。 我尝试将其修改为Click但无法执行此操作,因为它会抛出exception 请建议如何实现这一点。

强制xslt使用版本2和xslCompiledTransform

我有以下xslt,我需要使用像’format-date’这样的xslt版本2.0函数。 如何使用XsltCompiledTransform类(c#,。net 4.5)声明Xsl表使用2.0版。 table{border-collapse:collapse;font-family:”Verdana”;} table,td{border:1px solid black;color:black; background-color:white;font-family:”Verdana”;} table,th{border:1px solid balck;background-color:black;color:white;font-family:”Verdana”; } .rt{color:red;font-family:”Verdana”;} .nt{color:black;font-family:”Verdana”;} .redb{color:yellow; background-color:red;font-family:”Verdana”;} .greenb{color:white;background-color:green;font-family:”Verdana”;} .blackb{color:white;background-color:black;font-family:”Verdana”;} EDI validation Result EDI validation result of the PO received from . Position Item Code UoM Ordered Qty . Ship Request Net-Quoted Net-Catalog Status OK The order validation has failed, The order will not be processesed as […]

将标头添加到简单Web服务请求

我有一个控制台应用程序,我只需通过单击写入添加Web引用并使用“添加服务引用”,然后将我的.Config文件更改为: 所以,一切都很好,似乎我可以成功使用该服务,但服务文档说我需要在请求的标题上设置用户名和密码,这是文档的示例: user password … 那么如何在标题中添加用户名和密码? 有什么建议吗?

使用带有.net 4.5 beta的CSharpCodeProvider

我最近安装了Visual Studio 11 Beta,我正在尝试更新现有的4.0项目以使用4.5。 在程序中,它使用CSharpCodeProvider编译一些动态生成的代码。 /// /// Compile and return a reference to the compiled assembly /// private Assembly Compile() { var referencedDlls = new List { “mscorlib.dll”, “System.dll”, “System.Core.dll”, }; referencedDlls.AddRange(RequiredReferences); var parameters = new CompilerParameters( assemblyNames: referencedDlls.ToArray(), outputName: GeneratedDllFileName, // only include debug information if we are currently debugging includeDebugInformation: Debugger.IsAttached); parameters.TreatWarningsAsErrors = […]

App_Global.asax.compiled和App_Global.asax.dll丢失了吗? WebApi .NET 4.5项目

在我们使用WebAPI构建“简单”API的冒险过程中,我们已经像任何项目一样拥有了相当多的问题,但是我无法找到任何可以解释以下行为的资源: 细节 : Visual Studio 2013 with Update 2(但是,在更新之前,这是相同的) Windows Server 2008 R2 Web API 5.1.2 该问题似乎与“发布”命令有关,特别是“预编译”选项。 通过IIS Express运行时,我们看不到任何问题。 如果我们发布一次,则无法在bin目录中包含App_Global.asax.compiled和App_Global.asax.dll。 如果它正在更新应用程序的现有实例,它实际上将删除现有的两个文件。 注意:无论WebPublish或FileSystem Publish如何,都会发生这种情况 加载到IIS时,此行为导致404.0错误,而不是我们预期的201。 但是,如果我第二次发布没有更改以前的配置文件/配置,它会添加两个。 有一段时间,我们认为这是权限问题,并没有看到一致的行为。 这种情况发生在具有相同行为的所有开发机器上。 我们已经看到有关神秘行为的post,但从我们的分析来看,这是问题的根源。