Closed pingzing closed 6 years ago
Yep! It's what I'm using at the moment. As far as I can tell, the SDK-style .csproj won't accept uap10.0
as a TargetFramework without it.
Missed that, sorry! 😄 @onovotny is the author and is probably the best person to answer this question.
You cannot currently use the SDK style projects for an application itself, only for UWP class libraries. The project system needs to support deploying and launching it in the correct way as well.
Got it! Sort of what I expected. (Honestly kind of surprised I even got it to compile).
Thanks. I think we can close this issue now.
I got this answer on Twitter. Not an official statement of course, but still a pity.
@onovotny did you mean that, even with additions to MSBuildSdkExtras, we would depend on the MSBuild team to make SDK-style UWP projects possible?
It's possible to use the Extras for class libraries, but in order to use it for applications, it requires additional work from the project system as that handles deployment and starting the debugger.
Yes, I meant for applications. Thank you for the clarification.
@clairernovotny , it doesn't seem to be true that you can create UWP class libraries with SDK style projects. This Github issue seems to say that it's not possible: https://github.com/dotnet/sdk/issues/1408
Even this document says that uap and uap10.0 are supposed to be valid frameworks, but they just aren't. This is the error I get when I try to target either one in a SDK style project:
Severity Code Description Project File Line Suppression State Error NETSDK1013 The TargetFramework value 'uap' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. Device.Net C:\Program Files\dotnet\sdk\3.1.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 93
You can do it if you use the MSBuild.Sdk.Extras package: https://github.com/novotnyllc/MSBuildSdkExtras
You'll also need to use msbuild.exe
to build as dotnet build
doesn't have the correct targets.
@clairernovotny ok thanks. I'll try.
Is creating an UWP app project using the SDK.Extra style .csproj still impossible as of now?
I've used it but I ended up having to switch back to separate csproj files because of all the issues
(For additional context, I also posted this question on StackOverflow.)
So after some success in migrating a small WPF project to use the new SDK-style
.csproj
, I decided to try to see if it was possible to do so for UWP. Unfortunately, I seem to have hit a dead end, and decided to appeal to those who might know more.Is this possible, even theoretically? Can you offer any guidance on the two issues I'm experiencing?
1) Dependency
.dll
s aren't copied to /bin. 2) Visual Studio complains that built-in XAML types "aren't valid in a Universal Windows Project".For the sake of completeness, my
.csproj
looks like this:Would appreciate any information! Thanks!