MSBuildSdkExtras icon indicating copy to clipboard operation
MSBuildSdkExtras copied to clipboard

Working sample for VSfM

Open ZeProgFactory opened this issue 6 years ago • 10 comments

Hi, I'm searching for working sample for Visual Studio 2019 for Mac using MSBuildSdkExtras in order to debug/generate a Nuget for multiple platforms (for example Xamarin.iOS10 and Xamarin.Mac20) as I did in my sample for VS2019 ( https://github.com/ZeProgFactory/MSBuildSdkExtrasTest ).

When I try my test solution on VSfM 2019 it builds the netstandard2.0 implementation but not the rest ...

By the way I didn't get it to work on VS2019 either :-(

Heeeelp needed.

Thanks, Michael

ZeProgFactory avatar May 31 '19 15:05 ZeProgFactory

For 2019, you need to use the latest 2.x version of the SDK, can you try that?

clairernovotny avatar May 31 '19 15:05 clairernovotny

@jamesmontemagno any pointers?

clairernovotny avatar May 31 '19 15:05 clairernovotny

For Visual Studio 2019 version 16.1.2 will have the fix in it to make things work again. There is no support for Visual Studio for Mac currently.

jamesmontemagno avatar May 31 '19 16:05 jamesmontemagno

For 2019, you need to use the latest 2.x version of the SDK, can you try that?

I tried on VSfM 2019 and VS 2019, unfortunately it doesn't work. Here is the the VS2019.ErrorList.txt

On VS2017 no problem, everything is working fine.

My versions on (the same) PC:
Microsoft Visual Studio Professional 2017 Version 15.9.12
Microsoft Visual Studio Professional 2019 Version 16.1.1

And on the Mac:
Microsoft Visual Studio Enterprise 2019 Version 8.1 Preview build 2460

ZeProgFactory avatar May 31 '19 16:05 ZeProgFactory

The 2019 errors are the issue that is fixed in 16.1.2. There's no workaround that I know of until that's released.

clairernovotny avatar May 31 '19 16:05 clairernovotny

For Visual Studio 2019 version 16.1.2 will have the fix in it to make things work again. There is no support for Visual Studio for Mac currently.

Thanks for the quick answer @jamesmontemagno, but as I understood in https://developercommunity.visualstudio.com/content/problem/536913/vsfm-2019-doesnt-work-with-project-file-sdks-like.html in fact it should work on Mac currently !?!

ZeProgFactory avatar May 31 '19 16:05 ZeProgFactory

Oh interesting.... let me ask the team :)

jamesmontemagno avatar May 31 '19 16:05 jamesmontemagno

Visual Studio for Mac does not currently support multi-target project fully.

Support for building all target frameworks in a multi-target framework project was added recently, it looks like it will be in Visual Studio for Mac 8.2, which is not yet available. Earlier versions of Visual Studio for Mac will only build the first target framework. Only workaround would be to use msbuild from the command line.

The developer community post seems to be about not being able to build a project that used the MSBuild Sdk Extras at all, it does not indicate that all target frameworks will be built.

mrward avatar May 31 '19 17:05 mrward

Ok, that clarifies the situation. Thanks everybody 👍

ZeProgFactory avatar May 31 '19 18:05 ZeProgFactory

I updated my config to last Visualstudio versions and my sample https://github.com/ZeProgFactory/MSBuildSdkExtrasTest to last Nuget version. So now the current state for building with the IDE is:

Version State ...
Visual Studio Professional 2017 Version 15.9.13 OK Android, iOS, MacOS, UWP & WPF
Visual Studio Professional 2019 Version 16.1.3 OK* Mac for iOS, MacOS, UWP & WPF still not for Android
Visual Studio Enterprise 2019 (Preview) for Mac Version 8.2 Preview (8.2 build 732) OK* Mac for iOS & MacOS still not for Android

##Error on VSfM for Android##

Target _AddAndroidCustomMetaData:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(519,3): error MSB4044: The "FilterAssemblies" task was not given a value for the required parameter "DesignTimeBuild".
Done building target "_AddAndroidCustomMetaData" in project "ZeNuget.csproj" -- FAILED.

##Error on VS2019 for Android##

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB4044	The "GetAdditionalResourcesFromAssemblies" task was not given a value for the required parameter "AndroidNdkDirectory".	ZeNuget	C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets	482	

Any idea for the problem with Android?

ZeProgFactory avatar Jun 16 '19 12:06 ZeProgFactory