Xamarin-macios: Allow me to disable the SayHello build task for class libraries

Created on 14 May 2020  路  5Comments  路  Source: xamarin/xamarin-macios

Steps to Reproduce

  1. Create a multi-targeted class library that includes xamarin.ios targets.
  2. Build on Windows without a mac-host attached/
  3. Notice that the build takes a long time waiting for the SayHello build task to connect to a build host

Expected Behavior

Skip the sayhello task for class libraries - it's not needed, I want fast iterations on my work, which should include reducing build times. About 80% of my build time is because of this task.

Alternatively, let me at least disable it with an msbuild property so I can choose to skip it and speed up build times.

Actual Behavior

Compilation takes significantly longer because if this task that isn't even needed.

Environment

1.
Visual Studio: Help > About Microsoft Visual Studio > Copy Info [button]

Microsoft Visual Studio Enterprise 2019
Version 16.5.4
VisualStudio.16.Release/16.5.4+30011.22
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Enterprise

Visual C++ 2019 00435-60000-00000-AA944
Microsoft Visual C++ 2019

ArcGIS Runtime SDK for .NET 100.8.0
ArcGIS Runtime SDK for .NET allows developers to build immersive, native mapping applications for Windows, Android, and iOS devices using C#. It includes five APIs: WPF to create apps for Windows Desktop, UWP to create Universal Windows apps, Xamarin.Android and Xamarin.iOS for Android and iOS apps that need access to native functionality, and Xamarin.Forms to create apps that share UI layouts across Android, iOS, and UWP.

ASP.NET and Web Tools 2019 16.5.236.49856
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.5.236.49856
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 16.5.236.49856
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools 16.5.236.49856
Azure Functions and Web Jobs Tools

C# Tools 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30207.1

Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager 2.1.25+gdacdb9b7a1
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package 1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio 16.5.514 (c4f36a9)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 5.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Project System Tools 1.0
Tools for working with C#, VisualBasic, and F# projects.

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension 1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools 16.0.62003.05170
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 16.0.20225.2001
TypeScript Tools for Microsoft Visual Studio

UnoPlatformPackage Extension 1.0
UnoPlatformPackage Visual Studio Extension Detailed Info

Visual Basic Tools 3.5.0-beta4-20153-05+20b9af913f1b8ce0a62f72bea9e75e4aa3cf6b0e
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.8.0.0 for F# 4.7 16.5.0-beta.20181.6+85af456066acd4e76d2bc7821b44a325e46f2fca
Microsoft Visual F# Tools 10.8.0.0 for F# 4.7

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions (Preview) 1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake 1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Foo 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.5.000.533 (d16-5@9152e1b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 16.5.0.470 (remotes/origin/d16-5@681de3fd6)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.5.49 (0904f41)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 10.2.0.100 (d16-5/988c811)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: c0c5c78
Java.Interop: xamarin/java.interop/d16-5@fc18c54
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.28.0@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-5@9f4ed4b

Xamarin.iOS and Xamarin.Mac SDK 13.16.0.13 (b75deaf)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
```

VS bug #1125165

external-xamarin-vs

Most helpful comment

There is the same issue with msbuild when building from the command line. So this is not a VS issue.
I'm building the Vapolia.Xamarin.Svg.Forms nuget library since 5 years and this is a new issue.

@mandel-macaque Why would it be an issue with the VS team ?
It's a msbuild task that you created, it's not a problem with VS.

All 5 comments

@dotMorten this is an issue with the xamarin-vs team, the xamarin-macios project does not control that. It has been labeled so that you will get a reply from the correct team.

There is the same issue with msbuild when building from the command line. So this is not a VS issue.
I'm building the Vapolia.Xamarin.Svg.Forms nuget library since 5 years and this is a new issue.

@mandel-macaque Why would it be an issue with the VS team ?
It's a msbuild task that you created, it's not a problem with VS.

@softlion the sayhello task isn't defined in this repo. AFAIK it isn't open source, but this is the repo we'd usually report iOS issues in.

@brendanzagaeski this is a show stopper could you do something ?
In the family "i want to be as uneffective as possible" i take the king 馃憤

Interesting. I have a couple ideas that might help, but since I've been focused on Xamarin.Android for the past few years, I might be a little of the loop, so take these with a grain of salt.

  • It looks like the IsHotRestartBuild MSBuild property "unintentionally" already provides this feature. Set it to true to disable the SayHello task.

    SayHello takes only about 6 milliseconds when IsHotRestartBuild is set to true. The property is passed into the IsLocalDevice parameter of the SayHello task.

  • If the IsHotRestartBuild approach causes other problematic side effects, or if it ever stops working in the future, I'd recommend submitting an issue via Help > Send Feedback > Report a Problem in Visual Studio to help highlight the problem via one more communication channel with the team.

  • Just to write it down, an alternative, hackier workaround could be to forcefully disable the whole _SayHello target by opening the _.csproj_ file for the affected projected in a text editor and adding lines similar to the following at the end:

    <PropertyGroup>
      <BuildDependsOn>$([MSBuild]::Unescape($(BuildDependsOn.Replace('_SayHello;', '').Replace('_VerifyBuildSignature;', '').Replace('_VerifyXcodeVersion;', '').Replace('AfterConnect;', '').Replace('BeforeDisconnect;', '').Replace('_SayGoodbye;', ''))))</BuildDependsOn>
      <IsMacEnabled>false</IsMacEnabled>
    </PropertyGroup>
    <Target Name="_SayHello"></Target>
    </Project>
    
Was this page helpful?
0 / 5 - 0 ratings

Related issues

chamons picture chamons  路  4Comments

rolfbjarne picture rolfbjarne  路  4Comments

jzeferino picture jzeferino  路  3Comments

orryverducci picture orryverducci  路  4Comments

Mikilll94 picture Mikilll94  路  4Comments