.AddAutoMapper
is extension member to IServiceCollection
developed by Automapper developers. It is 3rd party extension, not Microsoft, thus you never find this in Microsoft release notes. 3rd party NuGet packages often include links to their docs, GitHub repos where you can find changes between 3rd party extension releases.
Where do I go to learn about changes to WebAPI's when new versions of .NET come out?
I'm going through a Pluralsight tutorial on creating .NET Core APIs using Visual Studio. The tutorial was authored back with .NET Core 2.2. I'm now using what I've learned in the Pluralsight course to write my own APIs. But I'm using .NET 5. This resulted in a problem, which I think is due to the difference in .NET Core versions.
The problem I ran into was in the ConfigureServices method of the Startup class. Speciflcally, this line:
services.AddAutoMapper();
That line worked fine, when using .NET Core 2.2. However, it caused me problems when I used .NET 5. I asked for help on Stack Overflow, and someone gave me a solution which builds and testing it I can retrieve data from the database. The above line of code is now like this:
services.AddAutoMapper(typeof(Startup));
I'm glad it works, but would like to know why it works. And I think it has to do with a change in .NET Core from 2.2 to 5. So, where do I go to learn about changes involving API's written with Visual Studio, from one .NET Core version to another?
-
Vadims Podāns 9,121 Reputation points MVP
2021-11-04T07:36:20.19+00:00
1 additional answer
Sort by: Most helpful
-
Bruce (SqlWork.com) 65,576 Reputation points
2021-11-04T14:59:43.047+00:00 The documentation has a what’s new in .net section which gives the changes for each release.
https://learn.microsoft.com/en-us/dotnet/fundamentals/
If you check the project references you will see what 3rd party packages you are using. The Microsoft ones start with system. or Microsoft.