As the title suggests, we are building a new application, and would like to set up our administration area as a new project as nopcommerce does.
We are trying this on a sample project at the moment, and what we have so far is :-
Created a new MVC Application called App1
Right clicked the solution > add new project - selected MVC application and changed the location to a new Admin folder under the App1 Application. This all now looks the same as nopCommerce.
Right clicked the Admin project, under build, changed the ouput to ..\bin\
As far as i can see, this seem to be it?
I rebuild the solution, and check the bin directory in application, and the dll's from the admin site are all there.
I release the main site (App1) and check. There is no Admin folder created, and no admin dll in the bin directory..
What other steps are we missing?
UPDATE : Ive added a new project into the nopcommerce solution, using the exact same steps 2 and 3, and this works with no issues. So it seems that there is something within either the webproject or against the solution in nopcommerce that is making this work. Any ideas?
Related
I am trying to install Umbraco 7.5.3 on an empty project but the back office has no items in the menus. It doesn't also load anything in the content tree.
I tried to do a clean installation based on this article but it was the same.
I went with a clean web application, I even select .net 4.5.1 in a try, and in the wizard part, I went with custom installation and in DB part I've entered the SA account.
Ok, I made it work. It sounds a bit strange, but it worked! I don't know why it wasn't on the how to page. and I still don't know what could be wrong :|
I had to set up the site on IIS and then accessing it using the domain address that I created.
So if anyone has the same problem do this:
1- create a new website set the directory to your websites address
(yourdomain.com==> c:...\yourUmbraco project)
2- go to hosts file and add your domain
(C:\Windows\System32\drivers\etc\hosts)
add
127.0.0.1 yourdomain.com
3- give access to your app pool worker (or everyone in your risk :D )
4- access your backoffice using yourdomain.com/umbraco
I have a production asp.net mvc website that I have been modifying and publishing through Visual Studio Express 2013. I wanted to create a development environment so that I'm not making changes to the production site/database. So, I did the following:
cloned the database and called it db-proj-dev
copied the source files for the project into a new folder called dbproj.dev
added the dev proj (dbproj.dev) to the same solution as the production project (so that easier to copy code from dev to prod)
modified web.config to point to the cloned database db-proj-dev
created a new publish profile pointing to dbproj.dev under inetpub
added a new website in IIS manager, pointing to the folder dbproj.dev under inetpub (port 10000 and same url as the default website)
What is happening now is that, when I bring up the dev site, it comes up to the home screen of the dev site, but if I click any of the links, it redirects to the main prod site. If I complete a form, the data gets posted to the production database. Does anyone know what I am forgetting or missing?
It sounds like you have absolute links in there - http://yoursite.com/thing/somepage rather than relative /thing/somepage.
I am new to MVC and want to migrate a Asp.net web application in MVC.
But i am stuck on how to deploy my web application on server IIS by copying all the source files on server (Xcopy deployment).
As in Asp.Net web application you can just create any new page and copy paste it on your webserver, it automatically gets compile and executed when browsed. Can this be done for MVC application??
I have even observed that when i host my MVC web application in IIS then any change in Views get reflected correctly without compiling the project , but i have to compile the project to make changes of controllers and models.
While you can add the App_Code directory to your asp.net MVC project by right-clicking on your project, as shown in the picture below, and put code in it that recompiles on the fly when it changes, in my opinion that's not a good solution. I will follow up the App_Code explanation with what I think you should do.
Clicking on the App_Code option will add that folder to your asp.net MVC project. Once you do that, you can add a class like the following to that folder:
public class TestClass
{
public string Description { get { return "Stuff"; } }
}
Then, in a view, you can create an instance of that class (which will be in the App_Code namespace by default, and reference the Description property like this:
#{
ViewBag.Title = "My View";
var test = new WebApplicationMVC.App_Code.TestClass();
}
<h2>#ViewBag.Title.</h2>
<h3>#ViewBag.Message</h3>
<h4>#test.Description</h4>
When you change the Description property's implementation, the site will recompile and use the new code. You could, for instance, change Description to return "More Stuff". In my opinion, recompiling like this on the fly is a bad solution. IIS handles site updates pretty well by overlapping the recycling anyway.
A better solution is to use the deployment wizard. The deployment wizard can deploy to your web server, Windows Azure, FTP, or local file system. And, the cool part about using the deployment wizard is that you won't end up uploading all of your source code to the server - it only copies what you need in order to run your site. To run the deployment wizard, right-click on your project and click the Publish option.
Once you are inside the deployment wizard, I recommend choosing Custom and then using the local file system option. Once you choose the local file system deployment option, you'll get the Settings tab where you can select Release or Debug (Release is recommended for production). Under "File Publish Options", I like to select the "Delete" option to remove all files from the deployment directory before copying new ones. Here is what the deployment wizard looks like:
This method of deployment does not allow you to deploy ad-hoc changes to controllers, models, etc; however, it is very clean and the proper way to deploy your site in my opinion.
You only need to copy from the deployment folder the files that you need to change. For example, if you just updated a view, you can copy just that view and the site will recompile that (as you've discovered). On the other hand, if you've changed something in a controller, copy the main assembly for your site, which is the dll, usually having the same name as your site, in the bin directory of the deployment folder.
I've just file system deployed an intranet site to one of our internal servers. The site is configured with it's own application pool w/.net 4. The site is configured to allow anonymous access. The NetworkServices account has read access to the directory/s. For trouble shooting purposes I have directory listing enabled.
When I hit the site I get the directory listing, why does the home/index page not come up as expected? Other servers that I have deployed to have just worked. I can not seem to find a difference here.
Also I have the site configured to come up as http: //myip:8081/
I've already run aspnet_regiis -I and checked to make sure the pool was the correct version.
I rolled back my .Net version from 4.5.1 to 4 and reinstalled all the nugget packages.
I have copied local all the DLLs just to be sure.
The original project was targeted to .Net 4.5 and I had down-converted to 4. I thought I had changed all references and configuration items but I must have missed something.
I created a new project targeting .Net 4 and copied my code files into the new project.
Compiled and deployed and all worked correctly.
Not sure what item in the web.config wasn't changed (or maybe something else in the project) but this worked and was fairly quick.
I have an MVC 3 app that has some core functionality (most important is autorisation) but mainly serves as a portal to different areas or modules. I want to organize thit to different modules that with minor changes also can be deployed as their own website.
The project consists of a Forum, Blog engine, Messaging between users + 4-5 upcoming modules.
I looked at ScottGu's blog about MVC 2 and found something that seemed perfect:
Depending og what the customer need I want to only give them the exact modules they can use. It is also easier from a maintainence view to be able to work and update referencd assemblies in each project and just do a full update for the customers that have that spesific module on their server.
But in MVC 3 there is no apparent way to use Areas this way, do you know how?
Status
I will try to add MVCContrib Portable areas to my existing solution and convert my areas ower and will post back the results. If it works I will mark it as the accepted solution.
MVCContrib has portable areas.
http://mvccontrib.codeplex.com/wikipage?title=Creating%20a%20Portable%20Area&referringTitle=Documentation
This is possible in MVC3:
From:
http://bob.archer.net/content/aspnet-mvc3-areas-separate-projects
Right click on the shell project and "Add Area...". Type in the area name. This will create an Areas folder with your area in it. (This is not 100% needed but you do need the "Areas" folder and you can steal the XXXXAreaRegistration class for your application.)
Create a new MVC3 empty project in your solution to match your area. Move the XXXXAreaRegistration.cs file from the shell mvc project to the new project and adjust the namespace as applicable. (Or you can manually create an area registration class, it's a pretty simple class. Just use the Add area template generated one as an example.)
Edit the routes in the AreaRegistration folder as needed.
Delete the folder under the areas folder that the template wizard added.
Modify the web.config of the new project and take out the connection strings and the authentication, membership, profile, rolemanger sections. You will not need to deploy this web.config but the razor intellisense doesn't work without it during dev time.
Delete the global.asax file from the area's project or you will get extra default routes.
Create a virtual directory in the "Areas" folder of the shell project with the name of your area as the alias and point it to your "area" project. You will need to use IIS or IIS Express for this. I use IIS. For IIS Express you can use the appcmd.exe in the IIS Express folder or you can edit the applciationhost.config file.