You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously, the EF tools (dotnet-ef) could be used on projects targeting multiple frameworks without specifying which framework to use.
46
+
47
+
#### New behavior
48
+
49
+
Starting with EF Core 10.0, when running EF tools on a project that targets multiple frameworks (using `<TargetFrameworks>` instead of `<TargetFramework>`), you must explicitly specify which target framework to use with the `--framework` option. Without this option, the following error will be thrown:
50
+
51
+
> The project targets multiple frameworks. Use the --framework option to specify which target framework to use.
52
+
53
+
#### Why
54
+
55
+
In EF Core 10, the tools started relying on the `ResolvePackageAssets` MSBuild task to get more accurate information about project dependencies. However, this task is not available if the project is targeting multiple target frameworks (TFMs). The solution requires users to select which framework should be used.
56
+
57
+
#### Mitigations
58
+
59
+
When running any EF tools command on a project that targets multiple frameworks, specify the target framework using the `--framework` option. For example:
60
+
61
+
```bash
62
+
dotnet ef migrations add MyMigration --framework net9.0
0 commit comments