Visual Studio 2022 - Properties Screen is partial - frameworks

I need to target my Visual Studio 2022 to target .NET 4.0 target framework. I followed the following link: https://devblogs.microsoft.com/visualstudio/revamped-project-properties-ui/
however the same screen look different on my machine, and the "application" group does not appear...Please see my screen below.
what am I doing wrong?

This issue was also reported on the Python Tools for VS GitHub repo (issue). The cause is that by default .NET projects default to 4.0 unless otherwise specified, but VS2022 does not support targeting 4.0. The workaround is to add this to your project file to retarget it to 4.7.2, which is supported by VS2022:
<PropertyGroup>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkMoniker>.NETFramework,Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
</PropertyGroup>

Related

.NET Maui - You are using a preview version of .NET - Where is this coming from and what version am I using?

I am running VS 17.3 Preview 6 on windows11. I have a .net maui app. when i load the app into vs, I get a message saying that I am using a preview version of .net. I don't think I've installed a preview of .net6 on this machine since it is pretty much brand new. i am using
.net 6.0 - ios for ios.
.net 6.0 - android for android.
.net 6.0 - windows 10.0.10941.0 for windows, but don't plan to build for windows.
Basically, why am i getting a message about using a preview version of .net? Is this some artifact message because I am using VS17.3 preview x? any idea how to make this go away since it is annoying? Is this due to .net 7 preview being installed with vs17.3?
To find out what version of MAUI you are using
Open solution or project in Visual Studio (Currently you should use Visual Studio Preview)
Right click on Project
Select Manage NuGet Packages...
Go to the register Installed
Check the versions of the packages Microsoft.Maui.Dependencies and Microsoft.Maui.Extensions
To find out what version of dotnet SDK you are using
Open PowerShell or cmd
Change directory to the path of your project
Execute dotnet --version

How to fix a packaged WinUI3 app build, what makes trouble with ProcessorArchitecture?

Today i'm trying to build a .NET 6 WinUI3 App in AzureDevOps. My csproj contains:
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>MyApp</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<ApplicationIcon>Assets\2764a994e49c43a2932b6d7f465e99eb.ico</ApplicationIcon>
<PlatformTarget>x64</PlatformTarget>
As "Build Platform" i have defined in Pipelines variable "x64". As error i become:
[error]C:\Users\VssAdministrator.nuget\packages\microsoft.windowsappsdk\1.1.2\buildTransitive\Microsoft.Build.Msix.Packaging.targets(1016,5): Error : Packaged .NET applications with an app host exe cannot be ProcessorArchitecture neutral. Please specify a RuntimeIdentifier or a Platform other than AnyCPU.
I'm wondering why this happens and how to fix it?
I figured this out! In Visual Studio, right click on your solution and click properties. For me, a few of the projects didn't have a Platform selected. I changed them all to x64 and the build succeeded. Hope this helps.

Can not change .Net Framework to 6.0 in Visual Studio 2022

Hey so I have Visual Studio 2022, I installed the .NET Framework 6.0.1 SDK manually from the microsoft website, If I check the Visual Studio Installer the .NET 6.0 Runtime is checked (means it is installed).
But I am neither able to retarget my existing Projects to 6.0, neither create a new Project for 6.0. The .NET Framework 6.0 simply doesn't appear in the dropdown selection.
I found another thread which had the same issue but nothing worked for me.
I've read that you can change the Targetframework editing the .csproj file with Notepad, I tried that but at start it told me I don't have the framework installed and either need to downgrade to 4.8 or install 6.0.1.
I've restarted and reinstalled Visual Studio several times now, same with my Computer.
What the heck is wrong here?

UWP: Folder in AppPackages is different from Package Family Name

I am developing a UWP app with Visual Studio 2019 Community 16.6.3.
When I run the app in Debug, Visual Studio deploys the app on my machine, creating a folder under
C:\Users\<MY_USER>\AppData\Local\Packages\
but the folder is named differently from the Package Family Name in my Package.appxmanifest.
Therefore (I guess), my connection to the MS Store is not working (I receive an error when I invoke the Store APIs) and also the OneDrive integration is broken.
Please note that my colleagues do not have any problem with the very same code-base (but they are working with Visual Studio 2019 Professional 16.5.5).
Is it a problem of the specific version of Visual Studio or is there anything in my code, in my machine or in my configurations that I should tweak?
Thank you!
Is it a problem of the specific version of Visual Studio or is there anything in my code
Please check if has modified the project's package family name, for the testing Visual Studio 2019 16.7.0 does not reproduce this issue. Please try to update the VS to latest version and delete installed app and re-build again.

Cannot get unity hololens project to work

I'm trying to get a project to work that i downloaded this link over here, from github.
I've followed all the (configuration) steps in the install guide and i am using the exact versions of the software as described in the guide.
The problem seems to be that some references to the Windows namespace do not work.
I've tried adding it but i can't get it done in the usual way.
The error messages i get when building in unity:
When i open the project in visual studio 2015 update 3 (after building it in unity):
It seems that the option to simply add the reference in visual studio is not present in this kind of project.
I think this shouldn't be to hard to resolve but i lack the skills and experience as i usually develop windows apps solely in visual studio.
EDIT
These are the configurations I used:
i open the project in visual studio 2015 update 3
You should use Visual Studio 2017 with the latest Win10 SDKs.