Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

Differences with WPF .NET

  • 2025-05-07
Feedback

In this article

This article describes the differences between Windows Presentation Foundation (WPF) on .NET and .NET Framework. WPF for .NET is anopen-source framework forked from the original WPF for .NET Framework source code.

There are a few features of .NET Framework that .NET doesn't support. For more information on unsupported technologies, see.NET Framework technologies unavailable on .NET.

SDK-style projects

.NET uses SDK-style project files. These project files are different from the traditional .NET Framework project files managed by Visual Studio. To migrate your .NET Framework WPF apps to .NET, you must convert your projects. For more information, seeHow to upgrade a WPF desktop app to .NET 7.

NuGet package references

If your .NET Framework app lists its NuGet dependencies in apackages.config file, migrate to the<PackageReference> format:

  1. In Visual Studio, open theSolution Explorer pane.
  2. In your WPF project, right-clickpackages.config >Migrate packages.config to PackageReference.

The Solution Explorer's context menu in Visual Studio, displaying the 'Migrate packages.config' item.

A dialog will appear showing calculated top-level NuGet dependencies and asking which other NuGet packages should be promoted to top level. SelectOK and thepackages.config file will be removed from the project and<PackageReference> elements will be added to the project file.

When your project uses<PackageReference>, packages aren't stored locally in aPackages folder, they're stored globally. Open the project file and remove any<Analyzer> elements that referred to thePackages folder. These analyzers are automatically included with the NuGet package references.

Code Access Security

Code Access Security (CAS) is not supported by modern .NET, it's a .NET Framework-only concept. All CAS-related functionality is treated under the assumption of full-trust. WPF for .NET removes CAS-related code. The public API surface of these types still exists to ensure that calls into these types succeed.

Publicly defined CAS-related types were moved out of the WPF assemblies and into the Core .NET library assemblies. The WPF assemblies have type-forwarding set to the new location of the moved types.

Source assemblyTarget assemblyType
WindowsBase.dllSystem.Security.Permissions.dllMediaPermission
MediaPermissionAttribute
MediaPermissionAudio
MediaPermissionImage
MediaPermissionVideo
WebBrowserPermission
WebBrowserPermissionAttribute
WebBrowserPermissionLevel
System.Xaml.dllSystem.Security.Permissions.dllXamlLoadPermission
System.Xaml.dllSystem.Windows.Extension.dllXamlAccessLevel

Note

In order to minimize porting friction, the functionality for storing and retrieving information related to the following properties was retained in theXamlAccessLevel type.

  • PrivateAccessToTypeName
  • AssemblyNameString
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo