R Siva
R Siva

Reputation: 11

ASP.NET Boilerplate template project build error

We are getting build errors in the startup template project downloaded from https://aspnetboilerplate.com/Templates

Downloaded startup template: ASP.NET Core 2.x Multi Page Web Application.

Errors:

  1. Error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) - MyCoreProject.Core - LoginManager.cs

  2. Error CS0246: The type or namespace name 'Abp' could not be found (are you missing a using directive or an assembly reference?) - MyCoreProject.Core - LoginManager.cs

  3. Error CS0308: The non-generic type 'PermissionChecker' cannot be used with type arguments - MyCoreProject.Core - PermissionChecker.cs

  4. Error CS1061: 'Type' does not contain a definition for 'GetAssembly' and no extension method 'GetAssembly' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?) - MyCoreProject.Core - AppVersionHelper.cs

  5. Package Microsoft.AspNetCore 2.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)

  6. Package Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.0.2 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.VisualStudio.Web.CodeGenerators.Mvc 2.0.2 supports: netstandard2.0 (.NETStandard,Version=v2.0)

  7. Package Microsoft.AspNetCore.Mvc 2.0.2 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Mvc 2.0.2 supports: netstandard2.0 (.NETStandard,Version=v2.0)

  8. One or more packages are incompatible with .NETCoreApp,Version=v2.0.

  9. One or more packages are incompatible with .NETCoreApp,Version=v1.0.

  10. Package Microsoft.AspNetCore.Authentication.Cookies 2.0.1 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Authentication.Cookies 2.0.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)

  11. Package Abp.ZeroCore.EntityFrameworkCore 3.5.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Abp.ZeroCore.EntityFrameworkCore 3.5.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)

Upvotes: 0

Views: 1893

Answers (3)

ISHATHKAJA
ISHATHKAJA

Reputation: 1

1) Install-Package EntityFramework
2) Add the below line in cs Projects
<ItemGroup>
    <Reference Include="netstandard" />
  </ItemGroup>
3) install netstandard from Nuget.
4)install this using package manager console 

Install-Package NETStandard.Library.NETFramework -Version 2.0.0-preview1-25305-02 -Pre
Install-Package NETStandard.Library.NETFramework -Version 2.0.0-preview2-25405-01 -Pre

5) Select the 'Web' project as the startup project.
6) Open the Package Manager Console, select the 'EntityFramework' project as the Default project and run EntityFramework's 'Update-Database' command. This will create the database. You can then change the connection string in the web.config.
7) Run the application. The default user name is 'admin' and the password is '123qwe'.

Upvotes: 0

Leo Liu
Leo Liu

Reputation: 76890

ASP.NET Boilerplate template project build error

After created and downloaded your project, you still need to follow the below steps to run your application:

  • Open your solution in Visual Studio 2017 v15.3.5+ and build the solution.

  • Select the 'Web.Host' project as the startup project.

  • Check the connection string in the appsettings.json file of the Web.Host - project, change it if you need to.
  • Open the Package Manager Console and run an Update-Database command to create your database (ensure that the Default project is selected as .EntityFrameworkCore in the Package Manager Console window).
  • Run the application. It will show swagger-ui if it is successful.

Note:If you have problems with running the application, close and then re-open Visual Studio again. It sometimes fails on the first package restore.

There are also have some requirements you have to prepare before you run this app:

  • nodejs 6.9+ with npm 3.10+
  • Typescript 2.0+

Then restore the npm packages:

npm install

For some more details info, please check the Documents for Startup Template Angular.

Upvotes: 0

Vivek Nuna
Vivek Nuna

Reputation: 1

I think you have an older version of Visual Studio, Following tools, are needed in order to use solution:

  1. Visual Studio 2017 v15.3.5+
  2. Visual Studio Extensions: Web Compiler and Typescript 2.0+
  3. nodejs 6.9+ with npm 3.10+
  4. gulp (must be installed globally)
  5. yarn
  6. SQL Server

Please Refer PRE REQUIREMENTS documentation.

Upvotes: 1

Related Questions