[ASP.net core 2.0 forward].net Core 2.0.3 has supported referencing a third party assembly.

Source: Internet
Author: User
Find Problems

In the process of upgrading FINEUIMVC (supporting asp.net MVC 5.2.3) to ASP.net Core 2.0, we found a strange phenomenon:

Project Reference Fineuicore project Everything is OK, but after compiling the Fineuicore, the reference to the Assembly will be an error:

This is strange, after a long toss, began to turn to the network. This look does not matter, a lot of complaints on the blow:

This article refers to:

Translation: You need to package the library as a NuGet package or as a reference to use the project. The technical reason is that all the required assemblies and versions are parsed during compilation and written to the. deps.json file. When a particular assembly is loaded, it may fail because the assembly or its dependencies (or conflict with one another) cannot be found.

The article even doubted whether Microsoft considered supporting the way the assembly was referenced:

Q: Does Microsoft allow ASP.net core apps to support only NuGet package references, or is this just a bug in the new technology?

A: NuGet packages are certainly the best way to add references, because they can be well integrated with the compile release process.

As I said, the problem mentioned above is indeed a bug, and we plan to fix it in a future patch version.

A similar question was found in the questions and answers of the blog park:

Solution

In the spirit of truth, I found the. Net Core download address, unexpectedly found yesterday just released a new version: Core 2.0.3

Download the. Net Core 2.0.3 64bit SDK Installer and install:

Go back to the previous error item and edit the csproj file:

Change the reference version of its Microsoft.AspNetCore.All from 2.0.0 to 2.0.3:

1 2 3 <ItemGroup> <packagereference include= "Microsoft.AspNetCore.All" version= "2.0.3"/> </ItemGroup>

Save, when vs will automatically restore the NuGet package:

Run, Done:

Original address: http://www.cnblogs.com/sanshi/p/7841104.html

. NET community news, depth good text, welcome to visit the public number article summary http://www.csharpkit.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.