How to use 2 asp.net projects together - asp.net-mvc

I'm working on a web application with asp.net mvc 4 and I want to do a administration interface,but I want do it in other visual studio's project. So I don't how it works, the routing, how connect to the database from other project. I'd really appreciate any help.

Follow this steps.
Create one solution
Add two projects to the same solution
Point the web.config of the two projects to the same database
It doesn't have to be so complicated with routing, because each project belong to a different site and a different environment.
In my opinion you should create just want project and define a new area for the administration

Related

How do ASP.NET areas map to teams?

I am trying to understand the concept of an MVC Area. I have read the following article: https://www.codeproject.com/Articles/714356/Areas-in-ASP-NET-MVC
In the linked article; there are areas for: Men; Women and Home. Where do you put the ASP.NET Identity classes? Homes?
Do you have any folders e.g. Controller; Model etc in the root folder? The root folder is the same folder as the Areas folder
Are areas used so that a large application can be worked on my multiple teams. For example, team 1 works on area 1 and team 2 works and area 2 and team x works on area x etc?
Say there are three teams. Is it possible for each team to create a new MVC project to work on. Then at deployment time the areas are combined to deploy as one web application
simply speaking areas are mvc project inside mvc project. You can use global ASP.NET Identity classes - in main mvc project or even configure for every area, but is it realy need to you?
You can have Controller; Model etc in the root folder in main mvc projects, also you can create it's inside every area. it depend from purpose. In most cases you will have them as in main as inside every area.
NO. areas used for Separation of the functional, creating something similar to modules. team must work with task< not with area. which task to work for team - it's jira or something similar. No relation to areas.
yes. it possible. but will be very difficult. for this purpose use version control and branches.

ASP.NET MVC and WebApi project in one solution

I have created solution with MVC and WebAPI empty projects.
The MVC one return SPA page which should communicate with WebApi project.
But when I set MVC as startup the WebApi one do not work.
How to do that?
#Edit:
Of course I want to do that:
localhost:xxxx/MVC/Index
localhost:xxxx/API/someapi
Right-click on the solution in the Solution Explorer and select "Set Startup Projects". In that dialog, set "Multiple Startup Projects" and indicate which projects represent applications you want to start automatically. In this case it would be your two web projects.
In VS.NET Solution Explorer, Right-Click your MVC Project and choose "Set as Startup Project".
For future reference, whatever project name is in bold in Solution Explorer is the startup project.
As David mentioned, your projects will be running on different ports as they should be. By default, VS.NET will use dynamic port assignment, but this behavior can be overridden on the Properties pages of each project.

Multiple projects in one solution like nopCommerce 3.5

How do I create 2 ASP.NET MVC projects in a single solution, similar to nopCommerce 3.5? The two projects would be:
Web project at http://localhost:15536
Admin project at http://localhost:15536/Admin
In NopCommerce physically there's no two project,
If you go physically you'll find the Nop.Admin project is under the Nop.Web project , and you have to create the second project and you refer to the http://localhost:15536 project in Visual studio and add the second project with add an existing project and you have to implement AreaRegistration to specify your Url in this second project and of corse your dll have to be generated under /bin of the first project.
Best Regards

How to use MVC4 SimpleMembership WebSecurity features in one VS project, but affect a different project in the same solution?

I have a VS C# solution using two different MVC4 with SimpleMembership EF projects. Each project has it's own database schema etc. separate from the other. I have it setup so that project B can access project A's models, and do CRUD operations. However, when I try to create a new user (for example using Websecurity.CreateUserAndAccount)all of that work will occur on that project only, and only affecting the database of that given project. So the question is, how can I use Websecurity features in project B, but actually affect the database in project A? (ie, somehow tell my project B that for this Websecurity.Whatever call, actually update/insert etc. into project A's database instead). Trying to avoid having to create my own custom membership if possible.
Thanks in advance for your time!

Can I create an ASP.NET MVC 2 project with multiple areas without referencing each Child in the parent area?

This is a follow-up question to my original query:
How can I use multiple projects to separate a large ASP.NET MVC site into departments?
Now that I have this working, is there a way to still have multiple project but not have to reference each child area from the parent project? Ideally I'd like to be able to have multiple, separate and distinct projects that only come together on the production/test machines. I should be able to build and test each "area" separately.
Not in MVC 2 Beta. Perhaps a future release.

Resources