简体   繁体   中英

How to Downgrade to .NET Core 1.0?

I am a beginner in .NET Core. I am learning Lynda's "Learn ASP.NET Core MVC The Basics" course. When I try to learn example code of Chapter 1, Video 5, this error appears:

HTTP Error 502.5 - Process Failure

Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect

For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681

After going through several questions on Stack Overflow, I find that it is caused due to the inclusion of older .NET Core Version (1.0) in the exercise files. But the Visual Studio in my computer has Version 2.1.4. The folder "wwwroot" in the exercise might also cause the issue.

It seems that the only way I can fix this issue is by downgrading to Version 1.0. But how can I do it? Do I have to uninstall Visual Studio Code and install it with .NET Core V 1.0?

"Downgrade" is not a feature that is supported in Visual Studio.

Option 1

Find a tutorial that uses .NET Core 2.0. Microsoft has really good tutorials and documentation, depending on what you want to cover.

.NET Core 1.0 was basically a beta that Microsoft called 1.0 . You gain nothing by learning .NET Core 1.0 at this point due to its limited amount of functionality (and usefulness) compared to .NET Core 2.0.

.NET Core 2.1 is soon to be released as well.

Option 2

Create a new project that targets .NET Core 1.0 in Visual Studio 2017 and put all of your .NET Core 1.0 code there.

  1. Choose ASP.NET Core Web Application and name the project. Click OK.

在此输入图像描述

  1. On the next screen, change the project to target .NET Core 1.0 from the dropdown. Choose any other options from the tutorial. Click OK.

在此输入图像描述

Option 3

Retarget your .NET Core 2.0 project to .NET Core 1.0.

  1. From Solution Explorer, right click the project and choose Edit <projectName>.csproj .

在此输入图像描述

  1. Change the TargetFramework element from netcoreapp2.0 to netcoreapp1.0 .

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp1.0</TargetFramework>
  </PropertyGroup>

  ...

</Project>
  1. Fix any compile issues that making this change will likely create. Every project will have different issues depending on what is referenced by the project. There is no guide for this, you need to do research to find out what the problems are and fix them yourself. Google is your friend.

NOTE: None of this will likely fix the underlying cause to your error message, which is a completely different Stack Overflow question than what you are asking here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM