Return to site

All Docs 1 6

broken image


The Apache Maven team would like to announce the release of Maven 3.6.1

Migrate from ASP.NET Core 1.x to 2.0.; 7 minutes to read +1; In this article. In this article, we walk you through updating an existing ASP.NET Core 1.x project to ASP.NET Core 2.0. Migrating your application to ASP.NET Core 2.0 enables you to take advantage of many new features and performance improvements. Back ALL DOCS - by category Plastic Surgery Facial Plastic Surgery Hair Restoration Orthopaedic Surgery Orthopaedic Spine Surgery Eye Surgery Neurologic & Spinal Surgery Cosmetic Dentistry Fertility Cosmetic Dermatology Pain Medicine Back ALL DOCS - by state AL: Alabama AZ: Arizona CA: California. Pillow is the friendly PIL fork by Alex Clark and Contributors.PIL is the Python Imaging Library by Fredrik Lundh and Contributors. Pillow for enterprise is available via the Tidelift Subscription.

Maven 3.6.1 is available for download.

Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central place.

The core release is independent of the plugins available. Further releases of plugins will be made separately. See the PluginList for more information.

We hope you enjoy using Maven! If you have any questions, please consult:

  • the web site: https://maven.apache.org/
  • the maven-user mailing list: https://maven.apache.org/mailing-lists.html
  • the reference documentation: https://maven.apache.org/ref/3.6.1/

Reporters and Contributors of this release

We really value the contributions of these non committers, so this section is focused on those individuals. Descriptions of the issues fixed can be found at the end of these release notes.

Issue Reporters of this release:

  • MNG-5705 Ondra Žižka
  • MNG-5965 Matthias Schmalz
  • MNG-6059 Andreas Sewe
  • MNG-6159 Christian Aistleitner
  • MNG-6213 Jin Kwon
  • MNG-6256 Christoph Etzel
  • MNG-6261 Dawid Weiss
  • MNG-6262 Gene Smith
  • MNG-6346 Patrik Jetzer
  • MNG-6374 Rohan Padhye
  • MNG-6495 Elliotte Rusty Harold
  • MNG-6506 Andreas Veithen
  • MNG-6526 Olaf Otto
  • MNG-6529 Michael Istria
  • MNG-6530 Michael Istria
  • MNG-6533 Michael Istria
  • MNG-6543 Romain Manni-Bucau
  • MNG-6558 Guy Brand
  • MNG-6577 Rohan Padhye
  • MNG-6591 Olaf Otto
  • MNG-6605 Gunnar Wagenknecht
  • MNG-6618 Viacheslav Yakunin

Code Contributors of this release:

  • MNG-6374 Gabriel Belingueres (indirectly via plexus-utils PR)
  • MNG-6529 Michael Istria
  • MNG-6530 Michael Istria
  • MNG-6558 Guy Brand
  • MNG-6261 Fabiano C. de Oliveira
  • MNG-6533 Michael Istria

Many thanks to all reporters and contributors for their time and support.

(Please send an email to the dev list if we missed one to mention).

Preliminary Testers

Thanks to the following preliminary testers:

  • Gabriel Belingueres
  • Francois Papon
  • Eric Lilja

All Docs 1 6 Equals

Known Issues

  • New attributes for URLs inheritance (see User Visible Changes) are not yet accepted during POM structure control on upload to the Central Repository: see MVNCENTRAL-4841 to track progress
  • If you are using Maven reporting, it might happen that you will get an exception which looks like this:

This is caused by using a . which does not contain a element.

Temporarily this issue can circumvented by adding an empty element inside the .

MNG-6636 issue has been created to track the fix in Maven 3.6.2.

Overview about the changes

  • An issue has been fixed causing multiple executions of plugin goals, related to using parallel build options like mvn plugin:goal -T 4. This resulted in duplicated executions of phases. This has been fixed with MNG-5965.

  • NullPointerException related to call in parallel build like mvn -T 1C clean javadoc:aggregateMNG-5705

  • A performance issue related to artifact transfer has been found related to WAGON-537. It has been solved via the update to Maven Wagon 3.3.1.

  • There had been issues related calling Maven script like this: mvn -f .

  • Having parentheses within the path, which has been fixed with MNG-6346.
  • Script can break having special characters as part of the path, which has been solved with MNG-6256.
  • Issue related to the Maven Resolver API which broke some IDEs (for example https://youtrack.jetbrains.com/issue/IDEA-201282); this has been fixed by MNG-6538.

  • Issue related to missing event for ToolchainsBuildingResult on EventSpy MNG-6558.

  • Issue related to support Java 9+ ClassLoader.findClass(String moduleName, String name) in Mojos. This has been fixed with MNG-6543. Exactscan pro 18 4 15 – powerful fast document scanning.

  • Improvement about the memory consumption has been done with MNG-6571.

  • Issue related to relative parent POM resolution failing in 3.5.0 with complex multimodule builds has been fixed with MNG-6261.

  • Missing export for org.slf4j.event.Level has been done with MNG-6618

User visible Changes

  • Maven has now a an option to suppress the transfer progress when downloading/uploading in interactive mode.

or in short:

  • There had been an issues like MNG-6505 and MNG-6059 related to the construction of URL's etc. within distributionManagement and scm part in the pom for multi module builds like this:

Detailed explanations can be found in Inheritance Assembly and in MNG-6059

The detailed issue list

Bugs:

  • MNG-5705 - NPE on parallel build in BuilderCommon.handleBuildError(BuilderCommon.java:147)
  • MNG-5965 - Parallel build multiplies work if multiple goals are given
  • MNG-5995 - Maven itself cannot run without maven-compat
  • MNG-6256 - Maven script can break if '-f' path contains special characters
  • MNG-6261 - Relative parent POM resolution failing in 3.5.0 with complex multimodule builds
  • MNG-6262 - getCanonicalFile() is not used consistently during project resolution
  • MNG-6346 - … was unexpected at this time when using -f option and path contains brackets
  • MNG-6374 - ModelBuilder hangs with malformed pom.xml
  • MNG-6429 - Integration Test site publishing requires Java 7 (or javadoc errors ignored)
  • MNG-6495 - ModelResolver cannot be null
  • MNG-6505 - child.(x.y).inherit.append.path value should be inherited
  • MNG-6506 - Mojos are unable to load package annotations on Java >= 9
  • MNG-6529 - ProjectBuilder.build(List projects, boolean, ProjectBuildingRequest) doesn't honor ProjectBuildingRequest.isResolveDependencies()
  • MNG-6530 - Regression in ProjectBuilder when file change between invocations (introduced by MNG-6311)
  • MNG-6533 - ProjectBuilder.build(list_of_projects,..) does not contain MavenProject in exception report
  • MNG-6543 - Upgrade plexus classworld to support java 9+ ClassLoader.findClass(String moduleName, String name) in Mojos
  • MNG-6558 - ToolchainsBuildingResult event is not sent on EventSpy
  • MNG-6577 - pom.xml: Uncaught IllegalArgumentException when parsing unicode entity ref
  • MNG-6590 - DefaultProjectArtifactsCache java.lang.IllegalStateException: Duplicate artifact resolution result
  • MNG-6599 - unknown version in model id when version is defined from parent

Improvements

  • MNG-6059 - Important use cases not covered, as child.inherit.append.path affects all children
  • MNG-6159 - Child path adjustments break git scm urls
  • MNG-6213 - Maven doesn't check the validity of scope value
  • MNG-6481 - Allow to compile and test Maven with Java 11
  • MNG-6513 - Replace depreated Plexus javadoc tags with annotations in ITs
  • MNG-6515 - Fix javadoc build errors under Java 8 and 11
  • MNG-6520 - Update assembly descriptors to 2.0.0
  • MNG-6522 - Prepare Maven's Core Integration Test Suite to test with Java 12 and 13-ea
  • MNG-6572 - use int or long instead of BigIntegers for little numbers in ComparableVersion
  • MNG-6593 - track input location for super-pom
  • MNG-6597 - add input location tracking for plugins configuration
  • MNG-6600 - add input location tracking for default lifecycle bindings executions
  • MNG-6601 - add input location tracking for site's reportPlugins injected by reports conversion
  • MNG-6605 - Allow to suppress download messages in interactive mode
  • MNG-6611 - Update animal-sniffer-maven-plugin to 1.17

Wish

  • MNG-6571 - Maven memory consumption issue

Task

  • MNG-6538 - Upgrade Maven Artifact Resolver to 1.3.3 to restore API
  • MNG-6544 - Replace CacheUtils#{eq,hash} with Objects
  • MNG-6573 - Use latest Maven 3.6.0 to build Maven Core and plugins with ASF CI
  • MNG-6618 - Maven doesn't export org.slf4j.event.Level

Dependency upgrade

  • MNG-6526 - Upgrade to Wagon 3.3.1 (from 3.2.0)
  • MNG-6591 - Upgrade to Wagon 3.3.2

Allmytube 5 4 5 download free. The full list of changes can be found in our issue management system.

Complete Release Notes

See complete release notes for all versions

-->

By Scott Addie

In this article, we walk you through updating an existing ASP.NET Core 1.x project to ASP.NET Core 2.0. Migrating your application to ASP.NET Core 2.0 enables you to take advantage of many new features and performance improvements.

Existing ASP.NET Core 1.x applications are based off of version-specific project templates. As the ASP.NET Core framework evolves, so do the project templates and the starter code contained within them. In addition to updating the ASP.NET Core framework, you need to update the code for your application.

Prerequisites

See Get Started with ASP.NET Core.

Update Target Framework Moniker (TFM)

Projects targeting .NET Core should use the TFM of a version greater than or equal to .NET Core 2.0. Search for the node in the .csproj file, and replace its inner text with netcoreapp2.0:

Projects targeting .NET Framework should use the TFM of a version greater than or equal to .NET Framework 4.6.1. Search for the node in the .csproj file, and replace its inner text with net461:

Note

.NET Core 2.0 offers a much larger surface area than .NET Core 1.x. If you're targeting .NET Framework solely because of missing APIs in .NET Core 1.x, targeting .NET Core 2.0 is likely to work.

If the project file contains 1.{sub-version}, see this GitHub issue.

Update .NET Core SDK version in global.json

If your solution relies upon a global.json file to target a specific .NET Core SDK version, update its version property to use the 2.0 version installed on your machine:

Update package references

The .csproj file in a 1.x project lists each NuGet package used by the project.

In an ASP.NET Core 2.0 project targeting .NET Core 2.0, a single metapackage reference in the .csproj file replaces the collection of packages:

All the features of ASP.NET Core 2.0 and Entity Framework Core 2.0 are included in the metapackage.

ASP.NET Core 2.0 projects targeting .NET Framework should continue to reference individual NuGet packages. Update the Version attribute of each node to 2.0.0.

For example, here's the list of nodes used in a typical ASP.NET Core 2.0 project targeting .NET Framework:

Update .NET Core CLI tools

In the .csproj file, update the Version attribute of each node to 2.0.0.

For example, here's the list of CLI tools used in a typical ASP.NET Core 2.0 project targeting .NET Core 2.0:

Rename Package Target Fallback property

The .csproj file of a 1.x project used a PackageTargetFallback node and variable:

Rename both the node and variable to AssetTargetFallback:

Update Main method in Program.cs

In 1.x projects, the Main method of Program.cs looked like this:

In 2.0 projects, the Main method of Program.cs has been simplified:

The adoption of this new 2.0 pattern is highly recommended and is required for product features like Entity Framework (EF) Core Migrations to work. For example, running Update-Database from the Package Manager Console window or dotnet ef database update from the command line (on projects converted to ASP.NET Core 2.0) generates the following error:

Add configuration providers

In 1.x projects, adding configuration providers to an app was accomplished via the Startup constructor. The steps involved creating an instance of ConfigurationBuilder, loading applicable providers (environment variables, app settings, etc.), and initializing a member of IConfigurationRoot.

The preceding example loads the Configuration member with configuration settings from appsettings.json as well as any appsettings..json file matching the IHostingEnvironment.EnvironmentName property. The location of these files is at the same path as Startup.cs.

In 2.0 projects, the boilerplate configuration code inherent to 1.x projects runs behind-the-scenes. For example, environment variables and app settings are loaded at startup. The equivalent Startup.cs code is reduced to IConfiguration initialization with the injected instance:

To remove the default providers added by WebHostBuilder.CreateDefaultBuilder, invoke the Clear method on the IConfigurationBuilder.Sources property inside of ConfigureAppConfiguration. To add providers back, utilize the ConfigureAppConfiguration method in Program.cs:

The configuration used by the CreateDefaultBuilder method in the preceding code snippet can be seen here.

For more information, see Configuration in ASP.NET Core.

Move database initialization code

In 1.x projects using EF Core 1.x, a command such as dotnet ef migrations add does the following:

All Docs 1 6
  1. Instantiates a Startup instance
  2. Invokes the ConfigureServices method to register all services with dependency injection (including DbContext types)
  3. Performs its requisite tasks

All Docs 2018

In 2.0 projects using EF Core 2.0, Program.BuildWebHost is invoked to obtain the application services. Unlike 1.x, this has the additional side effect of invoking Startup.Configure. If your 1.x app invoked database initialization code in its Configure method, unexpected problems can occur. For example, if the database doesn't yet exist, the seeding code runs before the EF Core Migrations command execution. This problem causes a dotnet ef migrations list command to fail if the database doesn't yet exist.

Consider the following 1.x seed initialization code in the Configure method of Startup.cs:

In 2.0 projects, move the SeedData.Initialize call to the Main method of Program.cs:

As of 2.0, it's bad practice to do anything in BuildWebHost except build and configure the web host. Anything that's about running the application should be handled outside of BuildWebHost — typically in the Main method of Program.cs.

Review Razor view compilation setting

Faster application startup time and smaller published bundles are of utmost importance to you. For these reasons, Razor view compilation is enabled by default in ASP.NET Core 2.0.

Setting the MvcRazorCompileOnPublish property to true is no longer required. Unless you're disabling view compilation, the property may be removed from the .csproj file.

When targeting .NET Framework, you still need to explicitly reference the Microsoft.AspNetCore.Mvc.Razor.ViewCompilation NuGet package in your .csproj file:

Rely on Application Insights 'light-up' features

Effortless setup of application performance instrumentation is important. You can now rely on the new Application Insights 'light-up' features available in the Visual Studio 2017 tooling.

ASP.NET Core 1.1 projects created in Visual Studio 2017 added Application Insights by default. If you're not using the Application Insights SDK directly, outside of Program.cs and Startup.cs, follow these steps:

  1. If targeting .NET Core, remove the following node from the .csproj file:

  2. If targeting .NET Core, remove the UseApplicationInsights extension method invocation from Program.cs:

  3. Remove the Application Insights client-side API call from _Layout.cshtml. It comprises the following two lines of code:

If you are using the Application Insights SDK directly, continue to do so. The 2.0 metapackage includes the latest version of Application Insights, so a package downgrade error appears if you're referencing an older version.

Adopt authentication/Identity improvements

ASP.NET Core 2.0 has a new authentication model and a number of significant changes to ASP.NET Core Identity. If you created your project with Individual User Accounts enabled, or if you have manually added authentication or Identity, see Migrate Authentication and Identity to ASP.NET Core 2.0.

Additional resources





broken image