Dnx using the Mono library to run Iboxdb and Nancy

Source: Internet
Author: User
Tags web database

Running Iboxdb with Dnxcore5 is described in the previous article, but if you use other components that do not support DNXCORE5, you will see the following prompt

/dnxcore/project.json (19,27): Error nu1002:the dependency Nancy 1.4.3 does not support framework dnxcore,version=v5.0.

Nancy is a practical. NET Web framework that simply makes a request test of its own server, with an average of 2000 requests per second, which can handle 100 million requests a day, which is sufficient for most sites, but currently it does not support Dnxcore.

At this point, you can change the run environment configuration, the Dnx "frameworks": {"Dnxcore5" ...} for "frameworks": {"Net45" ...}.

"Dependencies": {    "iboxdb": "2.7.0.3",    "Nancy": "1.4.3",    " Nancy.Hosting.Self ":" 1.4.1 "}," Frameworks ": {    " net45 ": {        " frameworkassemblies ": {            " system.runtime ":" 4.0.0 ",            " System.IO ":" 4.0.0 ",            " System.Collections ":" 4.0.0 "}}    }

You then set the path for mono on the terminal, and there are some differences in how paths are installed.

Export dotnet_reference_assemblies_path="/usr/lib/mono/xbuild-frameworks"

If the path is not set, the runtime will have the following prompt

Error dotnet1012:the Reference Assemblies directory is not specified. You can set the location using the DOTNET_REFERENCE_ASSEMBLIES_PATH environment variable.

Complete the basic setup can write code on the Program.cs, Iboxdb and Nancy are a few lines of code to complete a function of the design, the demo code here, a few lines of code to start the database, a few lines of code to start the Web server and implementation of the insertion and query functions, not here to copy again.

After writing the code, you can follow the instructions in the previous article.

dotnet Restoredotnet Run

Start the Web database application. Then open the browser, enter Http://localhost:1234/insert insert data, enter HTTP://LOCALHOST:1234/SELECT/1 query data.

  

Dnx using the Mono library to run Iboxdb and Nancy

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.