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.
Related
I'm trying to deploy one of the default template apps that VS2012 generates for MVC4 to a production server (not on Azure).
It turns out that I'm not smart enough to figure out how to get Web Deploy working. After spending an hour on diagnosing different 404s, 403s, and 401s, I am ready to either ditch Web Deploy altogether, or start my project using PHP instead.
Can I just copy and paste my files and put them somewhere?
I'm fine with manually updating the database schema.
Anything else that needs to be updated?
You can publish directly to "File System" via "Publish" menu in VS (choose folder on production server). Then create WebApp on IIS with this folder (on the server) choose ApplicationPool 4.0 open port for your application if needed and start it.
What in the world makes you even think you need to use web deploy? You do realize that the web publishing wizard has several options to choose from, including FTP, file system, etc... I don't see how you could miss these.
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 tried these steps but could not make it. When I browse my app it shows dll file.
Log onto the machine that is or will be hosting your application.
Use IIS Manager to create a new website for your application.
Create a new application in that site. I believe this also will automatically create an application pool with the same name for you and use it by default.
Specify the virtual directory for your application. This is going to tell IIS where to look for your mvc application. For this case lets assume it is C:\myApp
On your own machine Build the application however you build it with the correct solution configuration (i.e. Release mode). Lets say the result of your build is located at C:\MyProject\bin.
Copy C:\MyProject\bin from your machine onto your hosting machine at C:\myApp
I am a novice to this technology.
you shouldn't just drag the bin folder. it is everything else too like the images, css, jscript files as well as the cshtml files too (your views) to the c:\myapp folder.
or perhaps just do a publish within visual studio. maybe even take a look at this to see if this helps:
How to publish my MVC 3 web application onto IIS7
but generally speaking, I build the solution. I then create the vdir in my IIS. I copy the bin and view folder along with images/css/jscript/shared folders etc... to C:\my deployed site. I then convert to application for that vdir I just created in IIS.
You have to use publish action for ASP.Net web application(MVC, Forms and etc.)
I am in the introductory steps of teaching myself ASP.Net MVC 4 with the intent of converting old Classic ASP code. So, I have made a simple Hello World application in MVC4 and want to deploy it to our development server. The development server currently mirrors our production environment. The production environment hosts a bevy of Classic ASP pages, hosted in the "web" directory.
I have used the publish button in VS to upload the hello world page to the dev server, dropping it into the "web" directory. So, within the "web" directory, there are 2 new folders /bin and /Views. The actual page I created resides within the /Views/Home directory.
After the code was uploaded I pulled up IE and attempted to view the hello world page by navigating to localhost/views/home/index.cshtml and I received a 404 error.
I then pulled up the directory listing in IIS and navigated down to the "home" directory. I right-clicked this folder and selected "convert to application".
At this point I was able to see my hello world page by directing IE to the root localhost. However, after removing the "home" directory from the application list (essentially undoing the "convert to application"), the hello world page still shows when I pull up the root directory in IE. I've checked the default pages list in IIS, and my Classic ASP homepage still lists as the first selection.
So, I'm kinda confused on how to make MVC and classic asp play nicely together. First and foremost, I'd like to get my dev server pointing back to it's original default page so that it matches the production environment.
Create a separated directory for your MVC4 application beside the web directory. After this create a new web application inside the IIS console and point the source directory to your new application directory (set the new application's AppPool to integrated). Everything should work fine.
I have a question regarding Visual Studio 2010 publish feature which is used after you create a website (MVC framework) to push your dev changes to the live site.
I've never worked with MVC until a few weeks ago and
I've noticed that before pushing the website code I have to change everywhere where I have localhost in the code and replace it with the domain name I'm pushing to. Then if I want to debug anything on my local machine I have to revert everything back to localhost from domain name.
Q: Is there a way to not do this back and front url changing?
Basically I think it boils down to needing a software package or sth that knows to deploy the website with production configuration.
Maybe have a local branch and a live branch? This involves merging files all the time.
Thanks :)
I am not sure it works with MVC, but one approach we use for web services development is to use the web.config transformations.
This means that the normal development stuff is in Web.config and we have separate configurations depending on the deployment environment Web.staging.config and Web.production.config.