I wrote a simple web application on ASP.NET MVC3 (for example, app1). And I now want to write a simple CMS for it (for example, app2).
How can I access to folder app1/Content/ from app2, if app2 is an independed application?
In the future I want to copy app2 to one of the folders of app1 (for example, app2 path will be C:/app1/app2/)
Is this approach correct for building sites in ASP.NET MVC3? If not, please, recomend a better approach!
Sorry for my English.
First of all, yes, it’s not a very good design choice.
If you need some common stuff between the 2 applications, you can use several approaches, the simpliest that comes to my mind is to define in each application a variable in app settings (inside the web.config) pointing to a folder or URL containing the common stuff and use that.
Same thing if you need to use the same DB from more applications: just use the same connection string.
If you really need to make the 2 apps work together for some reasons, you should make one single app and a viable solution could be to split it using Areas.