-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support additional target frameworks such as for Xamarin, UWP, etc #491
Comments
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. |
Tizen should also be supported as a new and important member of the ecosystem. |
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. |
Any updates on this? |
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.
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.
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. |
What about ASP.NET Classic? |
@xperiandri are you serious? |
Me not, but enterprise yes |
Sorry I thought you were taking about pre-MVC |
@clairernovotny This should target .net 5 preview 3! |
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? 🙂 |
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 |
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. |
@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):
So, believe there's still a gap here? |
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. |
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:
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 requiremsbuild
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.The text was updated successfully, but these errors were encountered: