Sends for the fellow dear visitors:welcome to dongpad!


 Welcome to DongPad!

 msn


| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | > >> 预览模式: 普通 | 列表

A Look Back…

This Article is Published by Live Writer。

Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 996 | 返回顶部

Code Contracts from MSDN

Lots of fixes! Our new release, 1.2.21023.14, has been upgraded to work with Visual Studio 2010 Beta 2. (Of course, it also works with Visual Studio 2008, but this is a great time to download the new beta and get started with it.) There are lots of other improvements: be sure to check out the release notes. And keep using the forum to tell us what you think: many of the fixes were in response to your comments.

Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of pre-conditions, post-conditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation. Code Contracts bring the advantages of design-by-contract programming to all .NET programming languages. We currently provide three tools:

  • Runtime Checking. Our binary rewriter modifies a program by injecting the contracts, which are checked as part of program execution. Rewritten programs improve testability: each contract acts as an oracle, giving a test run a pass/fail indication. Automatic testing tools, such as Pex, take advantage of contracts to generate more meaningful unit tests by filtering out meaningless test arguments that don't satisfy the pre-conditions.
  • Static Checking. Our static checker can decide if there are any contract violations without even running the program! It checks for implicit contracts, such as null dereferences and array bounds, as well as the explicit contracts. (VSTS Edition only.)
  • Documentation Generation. Our documentation generator augments existing XML doc files with contract information. There are also new style sheets that can be used with Sandcastle so that the generated documentation pages have contract sections.

Code Contracts comes in two editions:

  • Code Contracts Standard Edition: This version installs if you have any edition of Visual Studio other than the Express Edition. It includes the stand-alone contract library, the binary rewriter (for runtime checking), the reference assembly generator, and a set of reference assemblies for the .NET Framework.
  • Code Contracts VSTS Edition: This version installs only if you have Visual Studio Team System. It includes the static checker in addition to all of the features in the Code Contracts Standard Edition.


Download Code Contracts Standard Editionor VSTS Edition.


Read the Code Contracts documentation.



forgot to leave the oraginal address:http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx

Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 974 | 返回顶部

“Out of the box”的解释

This Article is Published by Live Writer。

1)“Out of box”用于描述某种不确定的事件。常常作为副词来形容某种观点的不确定性。据说这个词同20世纪早期的英国数学家亨利?恩斯特?杜德耐解答一个著名数学谜语的思路相关。题目要求用四条直线连接平面上三乘三分布的九个点,要求一笔连成,也就是在画线的时候笔不能离开纸面。解决这个数学问题的关键在于要克服传统的在三乘三边界内画点的思想,如果将线连接到边界之外,那么问题可以迎刃而解,这样就产生了“Out of box”这个词。相应的,将思维受限这种情况称为“boxed-in”。在IT领域,节奏变化很快,因此每个人都在寻找“Out of box”的思维方式,尝试创新。
用“In the box”表示某种确定的事情。比如,最近有一篇文章讨论了MP3以及盗版音乐的关系,其中引用了一位业内人士的话表示:“主流唱片公司很少关心互联网上的发展,他们的思维就是‘Inside the box’”。
2)"Out of the box"(开箱即用)也用作"off the shelf"(现货供应)的同义词,其含义是指能够满足一定需求的、已经作好了的软件、硬件或两者的结合形式。如不采用,就需要投入专门的人力物力来开发。

out-of-the-box具有“创造性的,独特性,思维不合常规”的意思,但在计算机术语里又可以指“从盒子里拿出来直接可以使用的,也就是即开即用”的意思。"out-of-the-box" is similar to "off-the-shelf",
usually referinng to software/hardware which can be used as is, not requiring extra customisation or add-on components.”

转自:bokee

Tags: DongPad

分类:Life | 固定链接 |评论: 0| 引用: 0 | 查看次数: 932 | 返回顶部

WCF之消息队列问题

This Article is Published by Live Writer。

1.Q:此计算机上尚未安装消息队列

A:控制面板 --> 添加或删除程序 --> 添加/删除Windows组件 --> 勾选消息队列 --> 点击详细信息,将包括MSMQ HTTP支持在内的子组件都勾选上 -->确定完成。

上述方法主要是针对XP操作系统,更多安装步骤参见:官方的安装“消息队列 (MSMQ)”

2.Q:消息队列服务不可用

A:运行输入services.msc打开服务,找到Message Queuing服务,该服务主要用来为分布式异步消息应用程序提供通信基础结构,启动该服务即可解决消息队列服务不可用的问题。

Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 1023 | 返回顶部

WCF中的Binding模型简介

This Article is Published by Live Writer。

image

image

image

参见:http://dotnet.cnblogs.com/page/43947/

Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 933 | 返回顶部
起因:

有时可能会发生这样的情况,网站做好了,要在服务器上布署。布署中发现,有些地方代码需要小改,然而,在服务器或其他地方没有安装VS系列工具,但服务器上已安装有.net框架,此时仍然需要对已有项目的某些文件进行少量修改,并再次进行编译。此时,在服务器上安装VS系列开发工具并不可能,也不经济。那么下面的方法就可以派上用场了。

(1)将下面一行保存到你项目所在的目录下一个名为:buid.bat文件中:

%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe YourSolutionName.sln /t:Rebuild /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Build.log

关于buid.bat:前面名字可以随便取,后面一定是.bat,带bat后缀的是批处理文件。

(2)运行此buid.bat文件。

此时发现所在目录下多了PrecompiledWeb\工程名称\bin目录,下面有你需要的.dll。

(3)再COPY到你的相关网站目录下即可。

关于更多的MSBuild.exe命令及参数解释,这里就不多说,查一下MSDN或百度一下即可。

 

补充:有时候从网站上down的demo只有源码,但是又不想通过IDE打开,直接通过msbuild生成也是可以的。

语法: MSBuild.exe [options] [project file]
说明: 在项目文件中生成指定的目标。如果未指定项目文件,则 MSBuild 在当前工作目录中搜索扩展名以“proj”结尾的文件,并使用该文件。
开关:  

/help 

显示此用法信息。(缩写为: /? 或 /h)

/nologo  

不显示启动版权标志和版权信息。

/version  

仅显示版本信息。(缩写为: /ver)

@  

在文本文件中插入命令行设置。若要指定多个响应文件,请分别指定每个响应文件。

/noautoresponse  

不要自动包括 MSBuild.rsp 文件。(缩写为:/noautorsp)

/target:

在此项目中生成这些目标。请使用分号或逗号分隔多个目标,或者分别指定每个目标。(缩写为: /t) 
示例:/target:Resources;Compile

/property:=

设置或重写这些项目级属性。 为属性名, 为属性值。请使用分号或逗号分隔多个属性,或者分别指定每个属性。(缩写为: /p)
示例:/property:WarningLevel=2;OutDir=bin\Debug\

/logger: 

使用此记录器记录 MSBuild 中的事件。若要指定多个记录器,请分别指定每个记录器。
语法为:[,][;]
语法为:[.]
语法为:{[,] | }
是可选的,并按键入的形式原样传递给记录器。(缩写为: /l)
示例:/logger:XMLLogger,MyLogger,Version=1.0.2,Culture=neutral
     /logger:XMLLogger,C:\Loggers\MyLogger.dll;OutputAsHTML

/verbosity:

在事件日志中显示此级别的信息量。可用的详细级别有: q[uiet]、m[inimal]、n[ormal]、d[etailed] 和 diag[nostic]。(缩写为: /v)
示例:/verbosity:quiet

/console

logger

parameters:

控制台记录器的参数。(缩写为: /clp)

可用的参数有:
     PerformanceSummary - 显示任务、目标和项目中花费的时间。
     NoSummary - 不在末尾显示错误和警告摘要。
     NoItemAndPropertyList - 不在每个项目生成的开始显示项和属性的列表。
  示例:/consoleloggerparameters:PerformanceSummary;NoSummary

/noconsolelogger 

禁用默认的控制台记录器并且不将事件记录到控制台。(缩写为: /noconlog)

/validate 

  根据默认架构验证项目。(缩写为: /val)

/validate:

  根据指定架构验证项目。(缩写为: /val)
  示例:/validate:MyExtendedBuildSchema.xsd

示例: MSBuild MyApp.sln /t:Rebuild /p:Configuration=Release
        MSBuild MyApp.csproj /t:Clean /p:Configuration=Debug


Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 912 | 返回顶部

IIS无法启动之发生意外错误0x8ffe2740

This Article is Published by Live Writer。

解决方法
要解决这个问题,您可以进行以下任一项操作:
• 在IIS管理器中更改网站绑定端口为除80端口外的其它端口. 
• 停止正在使用80端口的应用程序,然后从IIS管理器中启动网站.

Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 542 | 返回顶部

SketchPath - The XPath Tool

This Article is Published by Live Writer。

I added another tool to my Toolbox yesterday: SketchPath.

The SketchPath site labels it as "The XPath Tool" but I'd say it more like "The XPath Tool."

I've seen a few other tools for quickly building and testing XPath expressions against an XML document, but they pale in comparison to SketchPath. There are a number of online tools that unquestionably require less effort to get started with, but you'll likely find them very limiting as well.

I know I'm not the only one who thinks SketchPath rocks. Scott Hanselman included it in his 2009 Ultimate Developer and Power Users Tool List for Windows.

If you do any significant amount of work with XML, I recommend you download SketchPath today.

 

Published Wednesday, November 18, 2009 4:40 AM by Jeremy Jameson

Filed under: Core Development

Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 958 | 返回顶部

What’s new in VS2010?

This Article is Published by Live Writer。

To see the highlights and what’s new in vs2010 please visit the follwing links: Visual Studio 2010 Product Highlights and What's New in Visual Studio 2010, especially What's New in Visual C# 2010 and What's New in the .NET Framework 4 !

Tags: DongPad

分类:C# | 固定链接 |评论: 0| 引用: 0 | 查看次数: 973 | 返回顶部

解决“远程下层文档”病毒攻击打印机问题

This Article is Published by Live Writer。

今天客户打印时遇到了一个"远程下层文档"而导致无法打印的问题,Google了一下,在此引用Peadog的文章,如下:

前言:进来集团很多共享打印机出现打印文件名为“远程下层文档”的异常打印任务,导致打印机队列堵塞,无法清除打印任务,甚至无法删除打印机。

解决思路:

1.停止/启动打印池服务

在服务控制面板中,停止/启动print spooler服务;

2.删除打印池文件

删除C:\WINDOWS\system32\spool\PRINTERS中所有队列文件;

3.对共享打印机设置相关访问权限,拒绝无关病毒主机对其进行访问。


补充:感性不知名的“51cto游客”

有一点需要说明:在\spool\Pinters\ 项下的异常打印文件可能无法删除,系统提示有其他用户或进程在使用这些文件。此时打开Task manager,在进程中找到spoolsv.exe并删除之。之后可以顺利删除异常打印文件。

Tags: DongPad

分类:Life | 固定链接 |评论: 0| 引用: 0 | 查看次数: 1937 | 返回顶部
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | > >>