Closed dotMorten closed 3 years ago
@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>
This is still an issue with net6-ios
. For a simple class library, 12.043s out of an 12.635s second build is spent on this task:
/cc @emaf
See: https://discord.com/channels/732297728826277939/732297916680765551/856654093560184852
Didn't this get fixed in .NET 6? Should it make a connection in a class library project at all?
I'm seeing this with .NET 6 preview 5.
Hi,
This issue has been fixed for good by avoiding to execute the SayHello task when no ServerAddress
input is passed to the target. Unfortunately this is not available in .net6 Preview 5 but you will be able to get the fix from Preview 6.
Thanks
This issue has been fixed for good by avoiding to execute the SayHello task when no ServerAddress input is passed to the target.
How do I control that though? I wasn't passing anything. And even if I was, why is this needed for class libraries?
@dotMorten iOS class libraries can also be built against the Mac, specially if you are referencing it from an iOS app or if you have any referenced framework (static or dynamic). If you build from command line you need to be explicit about the connection information to connect to a Mac (you need to set the MSBuiid properties) but if you build from VS this is implicit and directly passed from VS to MSBuild (with the connection information that VS already has). What the latest fix does is to avoid executing this connection task at all if no connection information is passed (from command line or VS). So you don’t need to control anything, meaning if you are building from VS and you are not connected to a Mac then the task will not be executed. On the other hand, if you are building from command line you decide if you want to do it against a Mac or not.
That is a curious explanation. I’m used to debug / build iOS apps from windows, and still have this message.
Steps to Reproduce
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