【问题标题】:Xamarin.Forms not debuggable in release modeXamarin.Forms 在发布模式下不可调试
【发布时间】:2020-02-17 20:01:05
【问题描述】:

我正在尝试将我的 Xamarin.Forms 应用发布到 Play 商店,我正在浏览 the prep doc

文档说我应该在 AssemblyInfo.cs 文件中包含以下代码。

#if DEBUG
[assembly: Application(Debuggable=true)]
#else
[assembly: Application(Debuggable=false)]
#endif

我环顾四周,但我只能在我的 obj 目录中找到这个文件,这意味着它是在构建过程中生成的。但不在我的 android 项目文件夹中(MyApp.Android\obj\debug 或发布目录)

cmets 表示此信息已过时,但并未提及 2020 年的工作方式。

我在哪里可以找到这些信息?

【问题讨论】:

    标签: debugging xamarin.forms


    【解决方案1】:

    .NET Standard 和 .NET Core 程序集不再包含 AssemblyInfo.cs(例如 see this question,实际上这与新的 Project 文件格式有关,但我相信 .NET Framework 程序集仍然包含 @987654324 @ 即使在当前版本的 Visual Studio 中)。现在从项目文件see the documentation 生成程序集信息属性。

    无论如何,没有什么能阻止您自己定义AssemblyInfo.cs。只需将相应的文件(或另一个.cs 文件,例如AssemblyProperties.csAssemblyAttributes.cs 行中的某些内容)添加到相关项目中,然后将这些行添加到该文件中。 .cs 文件的默认操作是编译它们,因此相应的行会自动编译到您的程序集中。

    【讨论】:

      猜你喜欢
      • 2014-02-18
      • 2012-05-19
      • 1970-01-01
      • 2018-09-16
      • 2011-09-02
      • 2010-11-17
      • 2012-06-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多