Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional target frameworks such as for Xamarin, UWP, etc #491

Closed
clairernovotny opened this issue Dec 14, 2016 · 18 comments
Closed

Comments

@clairernovotny
Copy link
Member

clairernovotny commented Dec 14, 2016

The current SDK is missing what should be static reference info for its property groups. That makes using multi-targeting much harder and puts more useless info in the csproj.

For example:
https://github.com/onovotny/Zeroconf/blob/367c63d21dacf841c204b13ea178fdce174bb93b/Zeroconf/Zeroconf.csproj#L3

All of those property groups should be in the SDK (with the possible exception of the TargetPlatformMinVersion attribute for UAP, but even there it can default to 10.0.10240 easily).

What should be in the SDK:

  • All "inbox" TFM's
    • All PCL profiles with standard aliases (portable-net45+win8+wpa81+wp8), etc. Bonus points for parsing and allowing any order of matching frameworks (via NuGet core logic in task?)
  • All installable frameworks (wp8, win, wpa, sl, uap, all Xamarin tfms)

Those property groups should include the appropriate LanguageTargets that point to the correct version to ensure a proper build. For a user, it should "just work".

I think it's ok that some TFM's cannot be built with dotnet build, but require msbuild so that it picks up the correct MSBuildExtension paths for built-in targets. Bonus points for an error/warning if the appropriate targets is missing telling the user to install foobar SDK to get it. Clearly some of these builds will only work on Windows too, but that's ok.

@srivatsn srivatsn added the Bug label Dec 21, 2016
@srivatsn srivatsn added this to the 1.0 RTM milestone Dec 21, 2016
@dsplaisted dsplaisted changed the title PropertyGroup's missing for TFM's Support additional TFMs such as for Xamarin, UWP, etc Jan 4, 2017
@dsplaisted dsplaisted changed the title Support additional TFMs such as for Xamarin, UWP, etc Support additional target frameworks such as for Xamarin, UWP, etc Jan 4, 2017
@dsplaisted
Copy link
Member

As part of this, we should also include the appropriate implicit framework references such as System, System.Core, etc for these platforms, like we currently do for .NET Framework.

@clairernovotny
Copy link
Member Author

Tizen should also be supported as a new and important member of the ecosystem.

@clairernovotny
Copy link
Member Author

clairernovotny commented Feb 12, 2017

I am attempting to do this in a NuGet package for RTW. Maybe some of it can be incorporated back here? https://github.com/onovotny/MSBuildSdkExtras

It supports all legacy PCL profiles except the XBox360 ones... Yes, WP7 and SL4 profiles work ;)

Order doesn't matter of the Portable- TFM's. What does matter is that you can't specify optional ones -- i.e., no Xamarin TFM's in the Portable section. NuGet ignored those anyway.

Feedback is appreciated, as is any direction as to how to incorporate into the main SDK.

@niemyjski
Copy link

Any updates on this?

azabluda added a commit to azabluda/InfoCarrier.Core that referenced this issue Oct 20, 2017
We have to wait for dotnet/sdk#491 (as per http://www.natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/) until we get better support for Xamarin.Android projects in dotnet/sdk. For now the project is excluded from the build. Enthusiasts may reactivate it in VS - Build - Configuration Manager.
azabluda added a commit to azabluda/InfoCarrier.Core that referenced this issue Oct 20, 2017
We have to wait for dotnet/sdk#491 (as per http://www.natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/) until we get better support for Xamarin.Android projects in dotnet/sdk. For now the project is excluded from the build. Enthusiasts may reactivate it in VS - Build - Configuration Manager.
@weitzhandler
Copy link

Is there a way to upgrade WPF projects to the new csproj format?

@thomaslevesque
Copy link
Member

Is there a way to upgrade WPF projects to the new csproj format?

There's no official support for it yet, but have a look at this project, which managed to make it work.

@xperiandri
Copy link

What about ASP.NET Classic?

@weitzhandler
Copy link

@xperiandri are you serious?

@xperiandri
Copy link

Me not, but enterprise yes
Is it a big deal to fix MVC 4-5 project launch on IIS?

@weitzhandler
Copy link

Sorry I thought you were taking about pre-MVC

@danielmeza
Copy link

@clairernovotny This should target .net 5 preview 3!

@jnoyola
Copy link

jnoyola commented Apr 24, 2020

From what I can tell from the release notes, it looks like this didn't make it into preview 3, is that correct? Is there any new timeline we can look forward to? 🙂

@riverar
Copy link
Contributor

riverar commented Dec 12, 2021

Did this ship? @clairernovotny

@mungojam
Copy link

Did this ship? @clairernovotny

I've been using it successfully with a xamarin android project, though I believe it is officially in preview as part of MAUI.

You need to add it as an optional workload. You can then do dotnet new to see what a new style project looks like

@marcpopMSFT
Copy link
Member

We'll not be adding all the old platforms but going forward with Maui, we believe the goals of this issue were covered so closing.

@hawkerm
Copy link

hawkerm commented Feb 4, 2023

@marcpopMSFT trying to multi-target to build on existing stable UWP while testing out the new WindowsAppSDK right now. I'd assume I could try going like this:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<TargetFrameworks>net7.0</TargetFrameworks>
		<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows')) or '$(EnableWindowsTargeting)' == 'true'">$(TargetFrameworks);net7.0-windows10.0.18362</TargetFrameworks>
		<TargetFrameworks>$(TargetFrameworks);uap10.0.17763</TargetFrameworks>

But this causes a failure (in VS 2022 17.4.4):

1>C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(1229,5): error MSB3644: The reference assemblies for UAP,Version=v10.0.17763 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

So, believe there's still a gap here?

@borrrden
Copy link

borrrden commented Sep 4, 2023

Definitely a gap. Seems like trying to rush Xamarin and UWP into sunset mode by making it harder and harder to build for them. I think the only way to multi target library for both legacy Xamarin and modern .NET mobile support is to use MSBuild.Sdk.Extras, which literally is only handled correctly by VS4Win. VS4Mac, Jetbrains rider, dotnet CLI and C# dev kit for VSCode all fail on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests