Intro to Sparkle 2. The Sparkle Interface 3. Preview Setup 4. Adding Box Elements 5. Managing Colors 11. Group Elements 13. Twitter & Facebook Widgets 14. Adding Photos & Graphics.
- NetSparkle is a software update framework for C# that is compatible with.NET Core 3+ and.NET Framework 4.5.2+, has pre-built UIs for.NET Framework (WinForms, WPF) and.NET Core (WinForms, WPF, Avalonia), uses Ed25519 or other signatures, and even allows for custom UIs or no UI at all!
- Sparkle is a Mac app that enables the creation of a successful website. A great Mac user interface makes simple things simple, complex things approachable, you have unparalleled control over the looks and the features of the website. Sparkle makes building websites fun again.
- Design your own Sparkle logo for free. This is a preview image.To get your logo, click the Next button.
- Sparkle, Visual Website Builder. Sparkle is the web design tool for creating modern sites with unparalleled creative control. Design a gorgeous site that works right out of the box.
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: Quiver 3 2 5 0.
Rename both the node and variable to AssetTargetFallback
:
Update Main method in Program.cs
Sparkle 1 2 2 – Visual Website Creator Download
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:
Cut out shapes 8 3 18. 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: Iscan police and fire scanner 3 4 3.
- Instantiates a
Startup
instance - Invokes the
ConfigureServices
method to register all services with dependency injection (includingDbContext
types) - Performs its requisite tasks
Sparkle 1 2 2 – Visual Website Creator Maker
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:
If targeting .NET Core, remove the following
node from the .csproj file:
If targeting .NET Core, remove the
UseApplicationInsights
extension method invocation from Program.cs: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.