How to properly work with wamp locally? - wampserver

I was working on my new project using wamp. Everything was fine until I uploaded the files to my real server (hostgator), where I already have another website hosted. I put the files of my new project in a subfolder so that it could work like a test environment. After that, whenever I try to open the home page of my new project in wamp I'm redirected to the page in my real webserver. I only want to work locally. What can I do to fix it? All I want is to use wamp locally to continue developing the new website.

Related

asp.net mvc create development environment

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.

How do you deploy a MVC4 .net app to production WITHOUT Web Deploy

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.

Deploying ASP.NET Web API App to IIS 7 On Different Server

I have been literally stuck for hours trying to deploy a Web API app to IIS. I can not believe there are no useful tutorials online anywhere that I can find. Here is my situation.
I have a VERY basic Web API app. It is using .NET Framework 4.0. It doesn't do anything I just want to see the home page at this point.
I am developing it in Visual Studio 2012 on my local machine. I can hit my localhost and see the home page, even post some data through Fiddler works great.
I publish the solution using Build->Publish to my local file system.
I then copy and paste everything in that directory to my web server (actually using a repository but for simplicity sake)
I created a brand new application pool in IIS. .NET 4.0 Integrated.
I placed the folder that contains my published code inside of the directory of my main website. The folder name is WebAPI.
I created a new website in IIS, attached to that new app pool I created.
I start the website, browse it on localhost and everything works perfectly.
I try to go to the website externally "website.com/WebAPI/api" and get a
403.14 - Forbidden The Web server is configured to not list the contents of this directory.
I'm sure I'm doing something wrong, I've never deployed an MVC app to IIS on another server. I'm able to deploy it just fine on my local machine through IIS too. What am I missing? Thanks!
Edit: Yes, my server has other .NET 4.0 apps running just fine.
http://localhost/api
http://website.com/WebAPI/api
Is this correct?
If so, looks like it could be a path problem.

Azure ASP.NET MVC Web.Config Deployment Issue

We are developing an ASP.NET MVC web app that will be hosted on Windows Azure. We have deployed the application a few times during development without any problems. It was actually quite surprising how smooth the process went. Then, when we went to deploy the app for beta testing we kept getting 403 Access Denied errors whenever we tried to navigate to the base url of the site. If we tried to navigate to any of the various Controllers and Actions of the site thereafter we would get 404 The resource could not be found errors.
The other strange thing that we noticed is that we had defined the authentication redirect page to be /Access/SignIn rather than the default Account/Login. Everything worked fine on the development machine and we were redirected to /Access/SignIn but when publishing to Azure we saw we were being redirected to /Account/Login. This made us think there was an issue with the web.config file.
We enabled remote desktop on the Azure deployment and took a look at the web.config file only to find out that it was almost completely empty! The only setting in there was the machineKey. We manually copied the web.config from one of our development machines up to the Azure virtual machine instance and everything started to work from there on.
What in the world would make the deployment wipe out the web.config file? And how can we prevent this from happening as we aren't going to be able to update the web.config file manually every time we deploy an update?
I often solve these sorts of problems by looking at the contents of the .cspkg file. This allows me to avoid waiting for the Azure package upload and initialization. Here are the steps to view the .cspkg contents:
Navigate to the /bin//app.publish folder
Rename the .cspkg file to .cspkg.zip.
Open .cspkg.zip. You will find a .cssx file (which is really a zip file) for each project referenced by the Azure project.
Extract the .cssx file you wich to inspect and rename it to .cssx.zip
Open the .cssx.zip and look around. For WorkerRoles, check out the approot folder. For WebRoles, check out the sitesroot folder.

MVC ActionLink adds VS solution name to url

For some reason when I run my project locally, everything works just fine. When I publish my site live to my shared hosting server, the actionlink causes links to come out as
http// www.mydomain.com/MySolutionName/Account.aspx/LogOn
when it should be
http// www.mydomain.com/Account.aspx/LogOn
Any ideas?
Check whether you published to a virtual directory named MySolutionName under the root of the web site. If you did, then this is expected behavior.
I thought that this was an option under the Publish screen (or maybe under the Project settings screen). I'm running on my MacBook so I can't confirm. Have you checked there to see?
Can you show some of the ActionLink code that you're talking about...?
(BTW: I have no idea why this site won't let me log back in. I never got an OpenID when I put in my new user info, wtf?)
I publish to a folder on my desktop and then upload via FTP. On my host I set the folder as an application directory since it's a subfolder of my root.
Root
./MySite
./MyOtherSite
Each folder is it's own application directory where I put different sites. There are no virtual directories that I know of. Since I cant see the server config, i can't be sure of that statement.

Resources