Best practices/guidance for maintaining assembly version numbers

I'm looking for pointers, suggestions, and even dictation on how to manage the three different assembly version numbers for a .NET assembly. The Product version is the simplest, as this seems would normally be dictated by business. Then, the file version seems to be for versioning between deployments, where the actual assembly version is only used when shipping. Right now I'm just loo

维护程序集版本号的最佳实践/指导

我正在寻找关于如何管理.NET程序集的三个不同程序集版本号的指针,建议,甚至是听写。 产品版本是最简单的,因为这似乎通常会由业务决定。 然后,文件版本似乎用于部署之间的版本控制,其中实际组装版本仅在运输时使用。 现在我只是寻找一个简单的方法来标记一个不依赖的程序集的测试和维护版本,所以我正在考虑在文件版本上自动递增构建版本和修订版本号,并且为了最终版本,复制当前版本文件版本到程序集版本。 该产品正

How best to use File Version and Assembly Version?

In .NET there are two version numbers available when building a project, File Version and Assembly Version. How are you using these numbers? Keeping them the same? Auto-incrementing one, but manually changing the other? Also what about the AssemblyInformationalVersion attribute? I'd found this support Microsoft Knowledge Base (KB) article that provided some help: How to use Assembly Ve

如何最好地使用文件版本和组件版本?

在.NET中,构建项目时有两个版本号,即文件版本和组件版本。 你怎么使用这些数字? 保持一致吗? 自动增加一个,但手动更改另一个? 还有AssemblyInformationalVersion属性呢? 我发现这个支持Microsoft知识库(KB)的文章提供了一些帮助:如何使用Assembly Version和Assembly File Version。 在我有多个文件程序集(即1个exe和5个dll)的场景中,我将为每个文件使用不同的文件版本,但是它们都使用相同的汇编版本,从而

integer, thousands separator, no decimal

what is the simplest String.Format template to format an integer with a thousands separator (comma) and no decimal places? en-US culture. Examples of desired formatting: 1200 = 1,200 900 = 900 8 = 8 thanks! N0 is the format you are looking for. N will format it with commas, and the 0 is to tell it to not use decimals: // will format as 33,540 string.Format("{0:N0}", 33540.54M) // examp

整数,千位分隔符,无小数

什么是最简单的String.Format模板来格式化具有千位分隔符(逗号)和无小数位的整数? 恩美文化。 所需格式的例子: 1200 = 1,200 900 = 900 8 = 8 谢谢! N0是您正在查找的格式。 N将用逗号将其格式化,而0则表示不使用小数位: // will format as 33,540 string.Format("{0:N0}", 33540.54M) // example using an integer: 1,200 string.Format("{0:N0}", 1200); 来自MSDN: 结果:积分和小数位,组分隔符和带可

Add comma thousand separator to decimal (.net)

I have a decimal number, say 1234.500. I want to get it to display 1,234.4 Im currently converting it to a double to remove the trailing '0's. string.Format("{0:0,0}",1234.500) removes the decimal place, and other formatting options seem to use two decimal places regardless. Can anyone offer insight? You should use a custom formatting like #,##0.00 string s = string.F

将逗号分隔符千位分隔符(.net)

我有一个十进制数,比如1234.500。 我想让它显示1,234.4 我目前将它转换为双精度去除尾随的'0'。 string.Format(“{0:0,0}”,1234.500)删除小数位,其他格式化选项似乎使用两个小数位,无论如何。 谁能提供见解? 您应该使用自定义格式,如#,##0.00 string s = string.Format("{0:#,##0.00}", xx); 将产生1,234.50当XX = 1234.5M 忘记转换为double ,这不会真的有帮助。 您是否知道.NET根据您的应用程

Remove hidden characters in WPF rich text box

(Since this question has not been getting any answers, I've re-worded it) In my application, I have a dialog that holds a Rich Text Box, the box is filled with a Tweet gathered from Twitter. Using the tweet entities I format the tweet to have in-line hyperlinks to links in the tweet, mentions, and hashtags. However, the hyperlinks are never positioned correctly; always being 2 or 3 chara

删除WPF富文本框中的隐藏字符

(由于这个问题没有得到任何答案,我已经重申了它) 在我的应用程序中,我有一个包含Rich Text Box的对话框,该框中充满了从Twitter收集的Tweet。 使用推文实体,我对推文进行格式化,以便在推文,提及和主题标签中包含内联超链接。 但是,超链接永远无法正确定位; 总是2或3个字符太快太远。 这是我用来在Rich Text Box中设置文本的代码: TweetText.Document.ContentEnd.InsertTextInRun(Status.Text) Dim FlowDocument

How to automatically select all text on focus in WPF TextBox?

If I call SelectAll from a GotFocus event handler, it doesn't work with the mouse - the selection disappears as soon as mouse is released. EDIT: People are liking Donnelle's answer, I'll try to explain why I did not like it as much as the accepted answer. It is more complex, while the accepted answer does the same thing in a simpler way. The usability of accepted answer is bette

如何自动选择焦点在WPF文本框中的所有文本?

如果我从GotFocus事件处理程序中调用SelectAll ,则它不适用于鼠标 - 只要释放鼠标,选择就会消失。 编辑:人们喜欢Donnelle的回答,我会尽力解释为什么我不喜欢它接受的答案。 它比较复杂,而被接受的答案以更简单的方式做同样的事情。 接受答案的可用性更好。 当您在文本中间单击时,释放鼠标时会取消选择文本以允许您立即开始编辑,如果您仍然想要全部选择,只需再次按下该按钮,这次它不会在释放时取消选择。 遵循Do

FlowDocument contents as text

What is the best way to get back the XAML/XML value of a FlowDocument? I noticed there isn't a .Value, .Text, .Caption, .ToXml(), etc... UDPATE: I'd like to be able to get access to it initially to serialize to disk or database. Treat it as its own document format. Later translating it to other formats would be nice. Also been wondering: Any equivalent to a hyperlink (opens in

FlowDocument内容作为文本

返回FlowDocument的XAML / XML值的最佳方法是什么? 我注意到没有.Value,.Text,.Caption,.ToXml()等等...... UDPATE: 我希望能够最初访问它以序列化到磁盘或数据库。 将其视为自己的文档格式。 稍后将其翻译成其他格式将会很好。 也一直在想: 任何与FlowDocument中的超链接(在新的浏览器窗口中打开)等效? 任何解决方法? 为了回应您的第一个问题,您可以使用XamlWriter将XAML作为字符串。 例如: Xaml

WPF FlowDocument Paragraph Inlines Length

Is there any limitations to the WPF Document.Paragraph object when using the FlowDocument control? I have the FlowDocument turning blank when I add a Paragraph that is more than 450 lines to the Paragraph. I could not locate anything within the MSDN documentation regarding max. lengths etc. Any ideas why this would happen? The issue is fixed when IsOptimalParagraphEnabled is set as False.

WPF FlowDocument段落内联长度

使用FlowDocument控件时,对WPF Document.Paragraph对象有任何限制吗? 当我在段落中添加段落超过450行的段落时,我将FlowDocument变为空白。 我找不到有关max的MSDN文档中的任何内容。 长度等 任何想法为什么会发生? 当IsOptimalParagraphEnabled设置为False时,问题得到解决。 然后会显示内容。 似乎这个属性导致大段落的问题。 我做了一个快速测试,并在段落中添加了10000次运行,并且FlowDocument似乎很好地显

Setting WPF image source in code

I'm trying to set a WPF image's source in code. The image is embedded as a resource in the project. By looking at examples I've come up with the below code. For some reason it doesn't work - the image does not show up. By debugging I can see that the stream contains the image data. So what's wrong? Assembly asm = Assembly.GetExecutingAssembly(); Stream iconStream = asm.

在代码中设置WPF图像源

我试图在代码中设置WPF图像的源代码。 该图像作为资源嵌入到项目中。 通过查看示例,我已经提出了下面的代码。 由于某种原因,它不起作用 - 图像不显示。 通过调试,我可以看到该流包含图像数据。 那么,怎么了? Assembly asm = Assembly.GetExecutingAssembly(); Stream iconStream = asm.GetManifestResourceStream("SomeImage.png"); PngBitmapDecoder iconDecoder = new PngBitmapDecoder(iconStream, BitmapCreateOp

TextBox should occupy available space and not grow when filled with text

I do have a Grid with two columns and two rows. In the first column, first row I do have this: <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Grid.ColumnSpan="1" Grid.Row="0" Grid.Column="0"> <StackPanel Orientation="Horizontal" Height="25" HorizontalAlignment="Stretch"> <Label Content="Text:"/> <TextBox Name="TB_Text" HorizontalAlign

TextBox应该占用可用空间,并且在填充文本时不会增长

我有一个两列两行的网格。 在第一列中,第一行我确实有这个: <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" Grid.ColumnSpan="1" Grid.Row="0" Grid.Column="0"> <StackPanel Orientation="Horizontal" Height="25" HorizontalAlignment="Stretch"> <Label Content="Text:"/> <TextBox Name="TB_Text" HorizontalAlignment="Stretch" MinWidth="120" />