2. Download the source code to build the development environment

1. Download the source code

    The latest version 1.10.2 released by Github in April 2017. The source code download URL is

https://github.com/OrchardCMS/Orchard/releases

    Three compressed packages are provided here, Orchard.Web is the compiled website building system; SourceCode is the source code. Open the source code zip package, read the readme document, and find that Azure provides cloud services for display. My account is logged in to Azure, and after a look, there are quite a few more functions. The website is: https://portal.azure.com/ In addition, you can also apply for a trial in Azure China, the website is: https://www.azure.cn/

    The first blog has mentioned that the next-generation product V2.0 using the core platform Orchard has been developed. Don't rush to use this, because the Core platform itself is not mature enough, and the version update is too fast. Therefore, Orchard 2 can be played, URL Yes: https://github.com/OrchardCMS/OrchardCore

2. Orchard source code compilation

    After loading the project with VS, it cannot be compiled directly. Because there is an exclamation mark in the reference, it means that there is something wrong with the project reference.

    I studied it for a long time back then and told everyone that the province took a detour. The solution is to directly update the AutoFac referenced by NuGet to the latest version. It's worth noting that the Orchard source code has a total of 93 projects, all of which have exclamation marks in them, but you don't have to use NuGet to update each project to the latest version. Update one and compile it directly, and the exclamation marks in other projects will disappear.

    However, you may also encounter a second pit. "Running error". I thought about it and thought it was a problem with the AutoFac version, so I downgraded the latest 5 to 4, and the error message became another place. So I downgraded to the original 3.5 version, and this time the compilation works fine.

    Feelings, the original version that came back in a circle? ? ? But solves the problem of quoting exclamation marks.

    It's a blunder that solves the error. Students who understand the wrong principle can tell me why.

3. Connect to the database

    VS running quickly shows the Orchard initialization page. Here you need to set the website name, set the database connection string, etc. It is worth noting that the database connection string, Orchard gives the format very user-friendly,

Data Source=.;Initial Catalog=WebMyWeb (the database name of the SQL Server you want to name);User ID=sa;Password=N33X

    Data Source , use a dot to represent the machine. Initial Catalog=WebMyWeb , you need to pay attention to this sentence, you can create an empty database named WebMyWeb in SQL Server in advance .

    This time SQL Server started to work. I used Profiler to see it and ran a lot of commands, which took a long time to stop. Open the WebMyWeb database of SQLServer, and there are already a lot of tables in it.


    Then you can see the home page of the website. Is it very simple?



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325567847&siteId=291194637