Differences between Microsoft .NET 4.0 full Framework and Client Profile

The Microsoft .NET Framework 4.0 full installer (32- and 64-bit) is 48.1 MB and the Client Profile installer is 41.0 MB. The extracted installation files are 237 MB and 194 MB respectively, and once installed, they are 537 MB and 427 MB. This is a difference of 110 MB. What difference is there between the two packages? When is it preferable to install the Client Profile instead of the full

Microsoft .NET 4.0完整框架和客户端配置文件之间的差异

Microsoft .NET Framework 4.0完整安装程序(32位和64位)为48.1 MB,客户端配置文件安装程序为41.0 MB。 提取的安装文件分别为237 MB和194 MB,安装后分别为537 MB和427 MB。 这是110 MB的差异。 这两个软件包有什么不同? 什么时候最好安装Client Profile而不是完整的.NET Framework? .NET Framework 4 Client Profile RTM中的新增功能解释了许多不同之处: 何时使用NET4客户端配置文件以及何时使用NET4 Full Frame

Nested/Child TransactionScope Rollback

I am trying to nest TransactionScopes (.net 4.0) as you would nest Transactions in SQL Server, however it looks like they operate differently. I want my child transactions to be able to rollback if they fail, but allow the parent transaction to decide whether to commit/rollback the whole operation. The problem is when the first complete occurs, the transaction is rolled back. I realize that co

嵌套/子TransactionScope回滚

我试图嵌套TransactionScopes(.net 4.0),因为它将在SQL Server中嵌套事务,但它看起来像它们的操作不同。 我希望我的子事务能够在它们失败时回滚,但允许父事务决定是否提交/回滚整个操作。 问题是第一次完成时,事务回滚。 我意识到完成不同于承诺。 我试图做的一个大大简化的例子: static void Main(string[] args) { using(var scope = new TransactionScope()) // Trn A { // Insert Data A

Best Design Pattern for the Following Scenario

I'm trying to improve my coding style. Consider the following scenario: Suppose that I want define a custom ASP.Net Album server control. The purpose is to let the user choose the album type and all other stuff will be carried out by the control. I have thought about 2 approaches: 1- Define an IAlbum Interface and define a class (which implements IAlbum) for every Album type. For exa

以下情景的最佳设计模式

我正在努力改进我的编码风格。 考虑以下情况: 假设我想定义一个自定义的ASP.Net Album服务器控件。 目的是让用户选择专辑类型,其他所有内容将由控制器执行。 我曾想过两种方法: 1-定义一个IAlbum接口并为每个相册类型定义一个类(实现IAlbum)。 例如: public class FlashAlbum : IAlbum { // Implement IAlbum Methods... // FlashAlbum-Specific Properties/Methods. } public class JSAlb

How to handle up to 100k HTTP connections in .Net

I am creating a server to monitor the online presence of clients on a webpage. There will be 80-100 000 (eighty thousand) simultaneous clients to monitor. I'm using .Net to write this. Clients will contact a (separate) server using JavaScript (on the HTML-page) to tell the server that they are alive/online. I'm considering one of two approaches: Persistent connections with keep-

如何在.Net中处理多达100k个HTTP连接

我正在创建一个服务器来监视网页上客户端的在线状态。 将有80-100,000(八万)个同步客户端进行监控。 我使用.Net来写这个。 客户端将使用JavaScript(在HTML页面上)联系一个(单独的)服务器,告诉服务器他们是活着的/在线​​的。 我正在考虑两种方法之一: 持续保持连接并定期发送。 当客户端断开连接时,这会给我更高的精度,并且我不需要经常更新内存结构(onlineinfo),因为我们知道客户端何时来去。 网络设备

Ignoring specified encoding when deserializing XML

I am trying to read some XML received from an external interface over a socket. The problem is that the encoding is specified wrong in the XML-header (it says iso-8859-1, but it is utf-16BE). It is documented that the encoding is utf-16BE, but apparently they forgot to set the correct encoding. To ignore the encoding when I deserialize I use a StringReader like this: private static T Des

反序列化XML时忽略指定的编码

我正尝试读取通过套接字从外部接口接收的一些XML。 问题是在XML-header中指定了错误的编码(它表示iso-8859-1,但它是utf-16BE)。 据记载,编码是utf-16BE,但显然他们忘了设置正确的编码。 在反序列化时忽略编码我使用如下的StringReader: private static T DeserializeXmlData<T>(byte[] xmlData) { var xmlString = Encoding.BigEndianUnicode.GetString(xmlData); using (var reader =

Why does Math.Round(2.5) return 2 instead of 3?

In C#, the result of Math.Round(2.5) is 2. It is supposed to be 3, isn't it? Why is it 2 instead in C#? Firstly, this wouldn't be a C# bug anyway - it would be a .NET bug. C# is the language - it doesn't decide how Math.Round is implemented. And secondly, no - if you read the docs, you'll see that the default rounding is "round to even" (banker's rounding):

为什么Math.Round(2.5)返回2而不是3?

在C#中, Math.Round(2.5)的结果是2。 它应该是3,不是吗? 为什么它是2而不是C#? 首先,这不会是一个C#错误 - 这将是一个.NET错误。 C#是语言 - 它并不决定Math.Round是如何实现的。 其次,不 - 如果你阅读文档,你会发现默认的四舍五入是“圆到平”(银行家的四舍五入): 返回值 类型:System.Double 最接近的整数。 如果a的小数部分在两个整数之间,其中一个是偶数,另一个是奇数,则返回偶数。 请注意,

In .net, how do I choose between a Decimal and a Double

We were discussing this the other day at work and I wish there was a Stackoverflow question I would point people at so here goes.) What is the difference between a Double and a Decimal ? When (in what cases) should you always use a Double ? When (in what cases) should you always use a Decimal ? What's the driving factors to consider in cases that don't fall into one of the two cam

在.net中,我如何选择Decimal和Double

我们前几天在工作中讨论这个问题,我希望有一个Stackoverflow问题,我会指出人们在这里如此。) Double和Decimal什么区别? 何时(在什么情况下)你应该总是使用Double ? 何时(在哪些情况下)应该总是使用Decimal ? 在不属于上述两个阵营之一的情况下, 需要考虑的驱动因素是什么? 有很多问题与这个问题重叠,但他们倾向于问某人在某个特定情况下应该做什么,而不是在一般情况下如何决定。 我通常会考虑自然与人

Azure Table Storage Performance from Massively Parallel Threaded Reading

Short version: Can we read from dozens or hundreds of table partitions in a multi-threaded manner to increase performance by orders of magnitude? Long version: We're working on a system that is storing millions of rows in Azure table storage. We partition the data into small partitions, each one containing about 500 records, which represents a day worth of data for a unit. Since Azure do

大规模并行螺纹读取的Azure表存储性能

简短版本:我们可以以多线程的方式从数十个或数百个表分区中读取数据,以提高数量级的性能吗? 长版本:我们正在研究一个将数百万行存储在Azure表存储中的系统。 我们将数据划分为小分区,每个小分区包含大约500条记录,代表一个单元的一天数据。 由于Azure没有“总和”功能,为了提取一年的数据,我们必须使用一些预缓存,或者在Azure网络或工作者角色中自行汇总数据。 假设如下: - 读取分区不会影响另一个分区的性能 -

Check if a program has thrown an exception

I'm working on a status monitoring program for my company and we need to be able to know if a process on a remote machine is hanging due to not responding (that I can do) or if it's thrown an unhandled exception. I've tried a number of things from checking the CPU usage of the process to checking if the process has gone idle. Nothing has really been reliable. Is there anyway to do

检查程序是否引发异常

我正在为我公司开发一个状态监控程序,我们需要能够知道远程机器上的进程是否由于没有响应(我可以这样做)而挂起,或者是否引发了未处理的异常。 我已经从检查进程的CPU使用情况到检查进程是否空闲,尝试了许多事情。 没有什么是真的可靠的。 无论如何要做到这一点? 我们要监控的所有程序都运行在.NET 3.5或4.0上。 如果您能够控制这些应用程序的来源,答案将会更容易。 我们处理这种情况的方式是,要监视的应用程序定

How do I set my mouse cursor to the hybrid hourglass and arrow in code? (.NET)

I have a timely operation that runs on a background thread. While running, I currently put the cursor in a wait state: Mouse.OverrideCursor = Cursors.Wait I just implemented a feature that allows the user to click a "Cancel" button if they're tired of waiting. However, some users may not realize they can do this (despite the cancel button being the only active control during the

我如何将鼠标光标设置为代码中的混合沙漏和箭头? (。净)

我有一个及时的操作,在后台线程上运行。 在运行时,我目前将光标置于等待状态: Mouse.OverrideCursor = Cursors.Wait 我刚刚实现了一项功能,如果用户厌倦了等待,可以单击“取消”按钮。 但是,有些用户可能没有意识到他们可以这样做(尽管取消按钮是该进程中唯一的主动控件),因为它们的鼠标光标是沙漏。 我见过程序使用显示沙漏的光标,并附带了箭头指针。 如何将鼠标光标设置为这种状态? 我查看了.NET文档,找不到