Generating version number in MSBuild

We have a C# solution with a WiX installer and an MSBuild build script. We're in the process of migrating from SVN to Git. As the fourth part of our version number, we want something that ascends with each build. Until now, we've used the SVN revision number for that. The MSBuild script defines a ProductVersion property, which included the SVN revision number as the final of the four

在MSBuild中生成版本号

我们有一个带有WiX安装程序和MSBuild构建脚本的C#解决方案。 我们正在从SVN迁移到Git。 作为我们版本号的第四部分,我们希望每次构建都能提升。 到现在为止,我们已经使用了SVN修订版号。 MSBuild脚本定义了一个ProductVersion属性,其中包含SVN修订版本号作为构建版本的四个数字的最后一个。 但是,我们不能再使用它了,因为我们不再使用SVN了。 我一直在试图找到SVN修订号的替代品,但我无法弄清楚要使用什么。 Jen

breaking changes in .NET

I would like to gather as much information as possible regarding API versioning in .NET/CLR, and specifically how API changes do or do not break client applications. First, let's define some terms: API change - a change in the publicly visible definition of a type, including any of its public members. This includes changing type and member names, changing base type of a type, adding/remov

在.NET中打破变化

我想尽可能多地收集有关.NET / CLR中API版本化的信息,特别是API更改如何做或不做中断客户端应用程序。 首先,我们来定义一些术语: API更改 - 对类型的公开可见定义(包括其任何公共成员)的更改。 这包括更改类型和成员名称,更改类型的基本类型,从类型的已实现接口列表中添加/删除接口,添加/删除成员(包括重载),更改成员可见性,重命名方法和类型参数,添加默认值对于方法参数,在类型和成员上添加/删除属性,以及在

Reference Prefixes in .NET XML Documentation

I've been attempting to fully document all types, methods, properties, etc. of a class library using XML comments but have run into a curious effect involving the cref attribute (used by see tags for example). Going by the advice of this MSDN page as well as following various other examples on MSDN and other websites, it seems that whenever one specifies a reference value using the cref tag,

.NET XML文档中的参考前缀

我一直在尝试使用XML注释完全记录类库的所有类型,方法,属性等,但却遇到了涉及cref属性的奇怪效果(例如, see标记)。 按照这个MSDN页面的建议以及MSDN和其他网站上的各种其他示例,似乎每当使用cref标签指定参考值时,它都必须以特定的标记作为前缀,这些标记会对refence进行分类(例如'T:'表示类型,'M:'表示方法)。 然而,使用微软Sandcastle,我发现通过错过这些前缀,在生成的文档(在这种情况下

Why is assignment of Double to Single allowed with Option Strict On

Why doesn't the following code cause a compile error, even though I have Option Strict On ? Dim value As Single = 12345.12345 ' No error The numeric literal is, by default, interpreted by the compiler as a Double . Converting from Double to Single is a narrowing conversion (the assignment, in this case, actually rounds the value to 12345.123 ). According to the MSDN article, Option Stric

为什么使用Option Strict On允许Double to Single分配

为什么下面的代码不会导致编译错误,即使我有Option Strict On ? Dim value As Single = 12345.12345 ' No error 数字文字默认情况下由编译器解释为Double 。 从Double转换为Single是一个缩小的转换(赋值,在这种情况下,实际上是将值四舍五入到12345.123 )。 根据MSDN文章, Option Strict On具有以下效果: 将隐式数据类型转换限制为仅扩展转换,禁止后期绑定,并禁止导致Object类型的隐式类型转换。 根据该描述,

What's the use of value types in .Net?

The official guidelines suggest that there can be very few practical uses for these. Does anyone have examples of where they've put them to good use? Au Contrare... you'll find C/C++ people flocking to structs aka value types. An example would be data packets. If you have a large number of data packets to transfer/transmit, you'd use value structs to model your data packets. r

.Net中值类型的用法是什么?

官方指导方针表明,这些可能很少有实际用途。 有没有人有他们在哪里使用它们的例子? Au Contrare ...你会发现C / C ++人群涌向结构aka值类型。 一个例子是数据包。 如果你有大量的数据包传输/传输,你可以使用值结构来模拟你的数据包。 原因:除了实例数据之外,将某些东西变为类会增加对象头中开销(大约8-16字节,我忘记)的开销 。 在不可接受的情况下,价值类型是最安全的选择 另一种用法是需要值类型语义的情况

When should I use a struct instead of a class?

MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class? Edit: Some people have forgotten that: 1. structs can have methods! 2. structs have no inheritance capabilites. Another Edit: I understand the technical differences, I just don't have a good feel for WHEN to use a struct. MSDN has the

什么时候应该使用结构而不是类?

MSDN说,当你需要轻量级对象时,你应该使用结构。 当一个结构比一个类更可取时,还有其他场景吗? 编辑: 有些人忘记了: 1.结构可以有方法! 2.结构没有继承能力。 另一个编辑: 我了解技术上的差异,我只是没有很好的感觉,因为什么时候使用结构。 MSDN有答案:在类和结构之间选择。 基本上,该页面为您提供了一个4项清单,并表示要使用一个班级,除非您的类型符合所有条件。 除非类型具有以下所有特征,否

Google API and .NET Compact Framework

I am developing a Windows Mobile 6.5 (.NET Compact Framework 3.5) app that will sync the device PIM data with Google Calendar and Google Tasks services. I obviously want to make use of Google API for .NET ( http://code.google.com/p/google-api-dotnet-client/ ) but apparently it is designed only for the standard, desktop version of .NET Framework. Trying to compile a CF3.5 project referencing th

Google API和.NET Compact Framework

我正在开发一个Windows Mobile 6.5(.NET Compact Framework 3.5)应用程序,它将设备PIM数据与Google日历和Google Tasks服务同步。 我显然想要使用Google API for .NET(http://code.google.com/p/google-api-dotnet-client/),但显然它仅用于.NET Framework的标准桌面版本。 尝试编译引用官方API .dll的CF3.5项目失败,例如“类型'System.Uri'在未引用的程序集中定义,您必须添加对程序集'System,Version = 2.

"Plugin" type logic that uses two assemblies

I'm working on a migration tool. I have two different assemblies one is Mapping that is used to collect data and store it in predefined types (say Customer , Product etc). That assembly is instanced in the Engine using reflection and the data is migrated to a destination platform (on a pretty hard coded way, we're having methods like MigrateCustomers and such). I'd like to rewrite

使用两个组件的“插件”类型逻辑

我正在开发一个迁移工具。 我有两个不同的程序集,一个是用于收集数据并将其存储在预定义类型(称为Customer , Product等)中的Mapping 。 该程序集使用反射在引擎中实例化,并将数据迁移到目标平台(以相当硬编码的方式,我们拥有像MigrateCustomers等方法)。 我想重写应用程序,使其更通用,允许客户(例如)扩展我们的Product类,并将逻辑注入到两个程序集中。 如果只有一个,我会创建一个接口,添加Execute()方法,这

differences between IoC containers

I'm looking for some guidance about how to chose an IoC container for an ASP.NET MVC application. What are the differences between (for example) StructureMap, Ninject, Castle Windsor, Unity, autofac and others? Can anyone give some hints or links to resource that might help chosing one library? Update : there is one question (Enterprise Library Unity vs Other IoC Containers) which talks

IoC容器之间的差异

我正在寻找一些关于如何为ASP.NET MVC应用程序选择IoC容器的指导。 (例如)StructureMap,Ninject,Castle Windsor,Unity,autofac等等之间有什么区别? 任何人都可以提供一些提示或链接到可能有助于选择一个图书馆的资源吗? 更新 :有一个问题(企业库Unity与其他IoC容器)讨论了IoC容器初始化的差异。 但是功能上有什么不同,这会使一些IoC容器成为ASP.NET MVC应用程序的更好选择吗? 这里有一篇有用的博客文章,

Good IOC Frameworks to use with asp.net mvc?

I am wondering what good simple IoC frameworks are there for asp.net mvc? that have good documentation and are just easy to get up and going. Thanks I've used Autofac and have been very happy with it. Configuration is mostly done in code so you get compile time checking for your mappings as opposed to programming in XML and hoping for the best. It also supports XML overrides though so

良好的国际奥委会框架与asp.net mvc一起使用?

我想知道什么好的简单IoC框架是否有asp.net mvc? 有很好的文档,并且很容易起来和去。 谢谢 我已经使用了Autofac,并对此非常满意。 配置主要是通过代码完成的,因此您可以在编译时检查映射,而不是使用XML进行编程,并希望获得最佳效果。 它也支持XML覆盖,所以如果你绝对需要在运行/部署时配置一些东西,这是可能的。 Contrib(不知道该怎么称呼它?)部分为NHibernate,Moq等提供了集成。该项目的创建者在微软的ME