gpt4 book ai didi

wpf - F# WPF 设置自定义程序集标题

转载 作者:行者123 更新时间:2023-12-01 14:59:49 25 4
gpt4 key购买 nike

我正在使用 F# WPF 设计一个消费者应用程序,我注意到在 C# 项目中没有等效的 AssemblyInfo.cs,我通常可以在其中定义自定义程序集标题。没有它,我的 F# 应用程序在任务管理器中显示为 MyApp.exe,而我希望它仅显示为 MyApp

This blog post建议手动创建 AssemblyInfo.fs。我试过这个:

module AssemblyInfo

open System
open System.Reflection;
open System.Runtime.InteropServices;

[<assembly: AssemblyTitle("MyApp")>]
do()

但它似乎不起作用。

如何在 F# 应用程序中设置自定义程序集标题?

最佳答案

我对此进行了调查,发现仅靠 AssemblyTitle 是不够的。如您所见,该标题将不会出现在任务管理器中。您需要提供更多属性才能使此属性起作用,但我不知道哪些属性有所不同。

这是我最初在 VS2015 中创建的项目中的文件。如果您在 VS2013 中使用它,请记住为您使用它的每个程序集生成一个新的 GUID。您可以在 VS 主菜单中的某处执行此操作。或者你可以买 quality GUIDs made in China .

程序集信息.fs

namespace SecondDemo.AssemblyInfo

open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("SecondDemo")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("SecondDemo")>]
[<assembly: AssemblyCopyright("Copyright © 2017")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("827700cd-54f6-4485-9239-fbd6af43c3e5")>]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]

do ()

关于wpf - F# WPF 设置自定义程序集标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41364717/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com