VS 2015 + all updates. Added an ASP .Net project with authetication (Identity) Aim - to separate the project into layers.
Layers:
DataAccess (All database tables, models etc)
BusinessLogic (CRUD operations)
Web Class Library (So i dont need to tie the DA and BL i added an extra layer to do this)
ASP .Net Web Application
- Move Models Folder into DA.
- Move IdentityConfig.cs into root of DA.
- Add all references required to DA, change namespaces accordingly. Project builds succesfully.
- Move Controller folder into BL.
- Add all references required to BL, change namespaces accordingly. Project builds succesfully.
- Move BundleConfig, FilterConfig, RouteConfig and Startup.Auth to the root of the Web Class library.
- Add all references required to the web library. Project builds succesfully.
- In the Web application i change the Startup and
Code in class and project:
using Microsoft.Owin; using Owin; using Company.Web; [assembly: OwinStartupAttribute(typeof(Startup))] namespace Company.Web { public partial class Startup { public void Configuration(IAppBuilder app) { ConfigureAuth(app); } } } Code in Startup.Auth
namespace Company.Web { public partial class Startup { // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864 public void ConfigureAuth(IAppBuilder app) { // Configure the db context, user manager and signin manager to use a single instance per request I get the error
Suppression State Error CS0103 The name 'ConfigureAuth' does not exist in the current context WebApplication1
I have a squiggle on 'Startup' with a friendly message:
[assembly: OwinStartupAttribute(typeof(Startup))]
The type 'Startup' in '....WebApplication1\Startup.cs' conflicts with the imported type 'Startup' in 'Company.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in '....WebApplication1\Startup.cs'.
The error
CS0103 The name 'ConfigureAuth' does not exist in the current context WebApplication1 ....WebApplication1\Startup.cs
So i researched around and seen a few links e.g
the name configureauth does not exist The name 'ConfigureAuth' does not exist in the current contex ASP.NET MVC OWIN and SignalR - two Startup.cs files
But cant work out if the way i have structered this project is incorrect or if im missing something obvious?