Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Conversation

@filipnavara
Copy link
Contributor

Fixes compilation against assemblies that have references to netstandard.dll, such as Xamarin.Forms.

The scenario is as simple as having a Xamarin.Forms app and adding this to a .cs file in the iOS project:

using Xamarin.Forms;

[assembly: ResolutionGroupName("MailClient.Mobile.Effects")]

Since the Xamarin.Forms.Core.dll is compiled with "System.Attribute" referencing "[netstandard]System.Attribute" this relies on the ImplicitlyExpandDesignTimeFacades build step doing the necessary expansions for the final compilation. This was previously not working and resulted in an error:

error CS0012: The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

Fixes compilation against assemblies that have references to netstandard.dll, such as Xamarin.Forms.
Comment on lines +49 to +53
<ItemGroup>
<DesignTimeFacadeDirectoryRoots Include="$(FrameworkPathOverride)" />
<DesignTimeFacadeDirectoryRoots Include="$(FrameworkPathOverride)Facades/" />
<DesignTimeFacadeDirectories Include="$(FrameworkPathOverride)Facades/" />
</ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do the same for Android and macOS, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very likely the answer is yes. I didn't test it though and it's almost midnight so it will have to wait till tomorrow... I have the test projects at hand, so it should be easy to verify.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also update a project to reference Xamarin.Forms in here:

https://github.com/xamarin/Xamarin.Legacy.Sdk/tree/main/samples

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android already seems to work correctly. macOS will need a similar fix as iOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@filipnavara
Copy link
Contributor Author

Side-note: The Mac build is likely going to be fixed by this GitHub Actions image upgrade soon. Not sure if it's worth creating a workaround at this point.

@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@jonathanpeppers
Copy link
Member

Let me revisit the CI setup on this repo, currently failing on a workload step:

Workload installation failed: Workload manifest dependency 'Microsoft.NET.Workload.Emscripten.net7' version '7.0.1' is lower than version '7.0.2' required by manifest 'microsoft.net.workload.mono.toolchain.net7' [C:\Program Files\dotnet\sdk-manifests\7.0.100\microsoft.net.workload.mono.toolchain.net7\WorkloadManifest.json]

@jonathanpeppers
Copy link
Member

Is there a way we can avoid this one on CI?

error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com./

Can we build for simulator instead? Seems like that would be ok.

@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@jonathanpeppers
Copy link
Member

AzDO is apparently refusing to build a PR from a fork...

@filipnavara
Copy link
Contributor Author

Is there a way we can avoid this one on CI?

error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com./

Can we build for simulator instead? Seems like that would be ok.

Yep. Simulator would be ok. I will change it when I get back home.

@filipnavara
Copy link
Contributor Author

filipnavara commented Jan 19, 2023

Can we build for simulator instead?

Done.

@jonathanpeppers
Copy link
Member

I triggered a manual AzDO run, then we can merge. Thanks!

https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7214530&view=results (sorry private link)

@jonathanpeppers jonathanpeppers merged commit c36b1c2 into xamarin:main Jan 19, 2023
@jonathanpeppers
Copy link
Member

I shipped an update if you want to try it out, thanks: https://www.nuget.org/packages/Xamarin.Legacy.Sdk/0.2.0-alpha3

@filipnavara
Copy link
Contributor Author

I shipped an update if you want to try it out, thanks: https://www.nuget.org/packages/Xamarin.Legacy.Sdk/0.2.0-alpha3

Thanks, already on it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants