Questions tagged [.net-7.0]

Use this tag for questions specifically related to version 7.0 of the .NET platform. For questions on .NET Framework generally, use the .net tag.

1169 questions
96
votes
8 answers

Equivalent to UserSettings / ApplicationSettings in WPF for newer .NET versions

What is the prefered way for persisting user settings for WPF applications with .net-5 , .net-6.0, .net-7.0 or .net-core>=3.0? Where are the .NET user settings gone? Created WPF .Net Core 3.0 Project (VS2019 V16.3.1) Now I have seen there is no…
MarkusEgle
  • 2,795
  • 4
  • 41
  • 61
45
votes
11 answers

SDK Resolver Failure - Net 7 - Net 6

Just downloaded and installed SDK Net 7.0.100 and it broke existing applications and they won't load any more in VS 2022 or Rider. Copied the follwing error: error : SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildSdkResolver"…
David
  • 583
  • 1
  • 4
  • 6
40
votes
3 answers

Could not load file or assembly 'System.Runtime, Version=7.0.0.0...' - After installing .NET Core 7 'dotnet watch run' not working

After the .Net 7.0 update, when I use dotnet watch run I get this error: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The…
Omer
  • 8,194
  • 13
  • 74
  • 92
26
votes
0 answers

Migrating the deprecated Microsoft.AspNetCore.Http.Abstractions nuget package

I have a .NET 7 Blazor helper library which has been referencing HttpContext from the Microsoft.AspNetCore.Http.Abstractions (2.2.0) nuget. However, this nuget is now flagged as deprecated by Microsoft, thus the Visual Studio Nuget manager shows me…
Ola Berntsson
  • 647
  • 1
  • 6
  • 12
17
votes
1 answer

Host.CreateDefaultBuilder vs Host.CreateApplicationBuilder in .NET Platform Extension 7

We generally Create Host using the Host.CreateDefaultBuilder() Method. The Host.CreateDefaultBuilder returns an IHostBuilder. The IHostBuilder has some extension methods by which we can configure the builder. After configuring the IHostBuilder We…
S.Nakib
  • 463
  • 7
  • 10
15
votes
1 answer

.NET 7 and UseEndPoints()

I am trying to convert a .NET Core 3.1 project to .NET 7. When I use this in my Program.cs class: app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); endpoints.MapControllerRoute( name: "default", pattern:…
SkyeBoniwell
  • 6,345
  • 12
  • 81
  • 185
13
votes
4 answers

Scaffold-DbContext from package manager console is giving a System.NullReferenceException

I have started to face this issue just recently. I'm using the Visual Studio 2022 Preview latest. I made a few simple changes to the DB and used the validation tool in dbForge Studio 2022 for SQL Server to validate all objects. The DB is valid. When…
DoomerDGR8
  • 4,840
  • 6
  • 43
  • 91
12
votes
2 answers

.NET 7 framework does not show up in Visual Studio 2022 version 17.4

After a long absence of C# I re-installed Visual Studio Community Version 2022 17.4.3. Then I installed dotnet-sdk-7.0.101-win-x64. Then I try to start a new console .NET application but I don't have the option to chose the .NET 7 framework. It goes…
Valmont
  • 328
  • 1
  • 2
  • 11
12
votes
3 answers

Getting 'import.meta' error when updating blazor app to dotnet 7

I have updated my code from dotnet 6 to dotnet 7. It builds and everything looks fine until i run it. Then i get the error message: Uncaught SyntaxError: Cannot use 'import.meta' outside a module (at dotnet.7.0.0.amub20uvka.js:8:27) Any ideas?
Cedervall
  • 1,309
  • 2
  • 13
  • 20
12
votes
2 answers

dotnet publish CLI exclude .pdb

In .NET 7, I do: dotnet publish --self-contained --configuration Release --runtime win7-x64 --output myapp How do I prevent .pdb files in the result? Ideally, just using the CLI? Are there any additional steps I can take to decrease the result…
kofifus
  • 17,260
  • 17
  • 99
  • 173
11
votes
2 answers

EF 7 - new ExecuteDelete and ExecuteUpdate methods not working on an in-memory database

I'm using the new EF 7 ExecuteDelete and ExecuteUpdate features and they are great. But when I try to write unit test for the functions that use them, these tests crash. I'm using EF 7.0.1 on .NET Core 7, Microsoft.EntityFrameWorkCore.InMemory…
10
votes
1 answer

.NET 7 JsonPolymorphic and EF Core 7 Json Column

I switched form .NET 6 to .NET 7 to make use of the polymorphic serialization with System.Text.Json. In WebApi, serializing and deserializing works like a charm using these types: [JsonDerivedType(typeof(FileMessageData), typeDiscriminator:…
martinoss
  • 5,268
  • 2
  • 45
  • 53
9
votes
4 answers

.NET 7: a connection was successfully established with the server, but then an error occurred during the login process

After I migrated my project to .NET 7 I had to add the TrustServerCertificate=true; setting in the connection string otherwise the following error is thrown: SqlException: A connection was successfully established with the server, but then an error…
Leomar de Souza
  • 677
  • 10
  • 23
8
votes
1 answer

Visual Studio 2022 Debugger thinks I changed code and wants to hot reload

EDIT: Good information provided below to diagnose, but the issue was I was running Visual Studio 2022 17.3. Version 17.4 is required for .NET 7, and I had just installed that. Once I installed the latest version of VS, all my problems went away. …
ScottG
  • 10,711
  • 25
  • 82
  • 111
8
votes
1 answer

.net maui publishing android app fails due to issue during linking

I have an .net maui application using .net 7 preview 2 that I want to publish for Android. My publish command: dotnet publish ${{env.UI_PROJECT_PATH}} -f net7.0-android -c Release This gives me this error: C:\Program…
NPadrutt
  • 3,619
  • 5
  • 24
  • 60
1
2 3
77 78