Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

.NET 7 release notes

Rolf Bjarne Kvinge edited this pageNov 11, 2025 ·11 revisions

We're excited to announce our .NET 7 SDK release!

Note: these are the base SDKs that add support for the platforms in question, if you are looking for .NET MAUI (which is built on top of our SDKs), go here instead:https://docs.microsoft.com/en-us/dotnet/maui/.

Getting Started |What's New |Known Issues |Feedback |FAQ

Versions

This release consists of the following versions:

Note that these versions do not support Xcode 14.1, an update with Xcode 14.1 will be released shortly.

Requirements

It's highly recommended to use Xcode 14.0+ (which requires macOS 12.4 (Monterey)). Earlier versions of Xcode may work, but some features won't be available.

With the release the minimum supported OS versions can be targeted for apps:

  • iOS: 10.0
  • macOS: 10.14
  • tvOS: 10.0
  • Mac Catalyst: 13.1

Note: while we support macOS 10.14, we're only testing on OS versions that Apple supports. At the time of this writing this means we're only testing on macOS 11.0+.

Getting started

In contrast to how Xamarin.iOS and Xamarin.Mac were shipped (as installable*.pkg files), our .NET SDKs are shipped as workloads in the .NET world. This means that the first step is to getting started is toinstall .NET 7.0.100 (or later).

Theninstall the workload corresponding with the desired platform:

$ dotnet workload install ios# other workloads: macos, tvos, and maccatalyst

Create new app from a template with:

$ dotnet new ios# 'dotnet new --list --tag Mobile' will show all available templates

Finally build and run the new app in the simulator

$ dotnet run

What's New in this Release

This release contains SDKs for the following four platforms: iOS, tvOS, Mac Catalyst and macOS, and has support and bindings for the OS versions that were shipped with Xcode 14.0:

  • iOS 16.0
  • macOS 12.4
  • tvOS 16.0
  • Mac Catalyst 15.4

What's Changed

New Contributors

Full changelog

Breaking Changes

Entitlements.plist is automatically picked up and used for entitlements.

If the root directory of the project file contains anEntitlements.plist file, we'll automatically pick it up and use it for entitlements when signing the app (previously theCodesignEntitlements property would have to be set in the project file).

In the case this is not desired, it's possible to get the old behavior back by setting theEnableDefaultCodesignEntitlements property to false in the project file:

<PropertyGroup>    <EnableDefaultCodesignEntitlements>false</EnableDefaultCodesignEntitlements></EnableDefaultCodesignEntitlements>

Ref:https://github.com/dotnet/macios/pull/15729

Release builds for macOS and Mac Catalyst are universal by default.

We've made release builds (builds whereConfiguration=Release) default to be universal, so that release builds won't have to be translated by Rosetta on ARM64 macOS devices.

If this is not desired, it can be overridden in the project file by doing something like this:

<PropertyGroupCondition="'$(Configuration)' == 'Release'">    <RuntimeIdentifier>maccatalyst-x64</RuntimeIdentifier></PropertyGroup>

Ref:https://github.com/dotnet/macios/issues/15620

Iterating over a generic NSArray may require a cast

We've made theNSArray type implement theIEnumerable<NSObject> interface,so now this works:

vararray=newNSArray();foreach(varelementinarray){// ...}

However, this has a somewhat unfortunate side-effect, because enumerating overan instance of the genericNSArray<TKey> type doesn't compile anymore:

vararray=newNSArray<NSString>();foreach(varelementinarray){// Fails to compile with:// error CS1640: foreach statement cannot operate on variables of type 'NSArray' because it implements multiple instantiations of 'IEnumerable'; try casting to a specific interface instantiation}

This happens because theNSArray<NSString> instance implements bothIEnumerable<NSString> andIEnumerable<NSObject> (sinceNSArray<NSString>is a subclass ofNSArray).

The fix is to cast toIEnumerable<NSString> like this:

vararray=newNSArray<NSString>();foreach(varelementin(IEnumerable<NSString>)array){// This works}

Unfortunately the compiler error when using LINQ is a bit more confusing:

usingSystem.Linq;vararray=newNSArray<NSString>();varlist=array.ToList();// Fails with:// Error CS1061: 'NSArray<NSString>' does not contain a definition for 'ToList' and no accessible extension method 'ToList' accepting a first argument of type 'NSArray<NSString>' could be found (are you missing a using directive or an assembly reference?)

On the other hand the solution is somewhat easier on the eyes, just specific thegeneric type in the call toToList:

usingSystem.Linq;vararray=newNSArray<NSString>();varlist=array.ToList<NSString>();

Note: this does not affect any existing binaries (such as NuGets), it's purelyan issue when building from source code.

Ref:https://github.com/dotnet/macios/pull/16252

Changed availability attributes

We've taken advantage of the newObsoletedOSPlatform attribute in .NET 7 in orderto properly annotate API that has been obsoleted (previously we had to markthese APIs with anUnsupportedOSPlatformattribute, which didn't describe the situation accurately).

A side-effect of this is that the warning number and text has changed.

For example code like this:

Console.WriteLine(NSColor.WindowFrame);

would previously report CA1416:

Error: AppDelegate.cs(20,27): warning CA1416: This call site is reachable on: 'macOS/OSX' 10.14 and later. 'NSColor.WindowFrame.get' is unsupported on: 'macOS/OSX' 11.0.0 and later.

and now it reports CA1422:

Error: AppDelegate.cs(20,27): error CA1422: This call site is reachable on: 'macOS/OSX' 10.14 and later. 'NSColor.WindowFrame.get' is obsoleted on: 'macOS/OSX' 11.0 and later (Use 'NSVisualEffectMaterial.Title' instead.).Error: AppDelegate.cs(20,27): error CA1422: This call site is reachable on: 'macOS/OSX' 10.14 and later. 'NSColor.WindowFrame' is obsoleted on: 'macOS/OSX' 11.0 and later (Use 'NSVisualEffectMaterial.Title' instead.).

References:

Known Issues

Hot Reload on device doesn't work

We're aware of an issue where hot reload doesn't work when executing an app onan iOS or tvOS device. This will be fixed in a future service release.

Can't run mobile app from the command line on Windows

It's currently not possible to run a mobile app (iOS, tvOS) on Windows usingthe command line. Please use an IDE to launch apps from Windows.

Ref:https://github.com/dotnet/macios/issues/16609

FAQ

How to run on Device/Simulator from the command line

The general process is documented here:

https://docs.microsoft.com/en-us/dotnet/maui/ios/cli

but does not include running on an attached device.

To do that, include-p:RuntimeIdentifier=ios-arm64, along with the other parameters.

dotnet build -t:Run -f:net7.0-ios -p:RuntimeIdentifier=ios-arm64 -p:_DeviceName=MY_SPECIFIC_UUID

with MY_SPECIFIC_UUID found asdescribed here but for your device.

Note that thisdoes not work from Windows, only from a Mac.

Feedback

File issues here:https://github.com/dotnet/macios/issues/new.

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp