I have been using the embedded server that visual studio has to test my ASP.NET MVC 3 application and it has been working fine. I decided that I want to start using IIS on my local machine for my personal development environment as that is how the application is going to have to be deployed.
I installed IIS through the control panel on Windows 7 (so I am assume it is version 7/7.5) and enabled basically every option. I then open up the IIS Manager and added the website. I also added an entry in my hosts file so that the domain I gave the IIS Manager maps to 127.0.0.1.
I then started Visual Studio (as administrator) and opened up the solution. I changed the properties for a few of the references as mentioned in a "How to Web Deploy ASP.NET Applications" article (like System.Web.MVC, System.web.Routing, and a few others). I then went to the main project, right-clicked and clicked publish. I set everything in there for Web Deploy and published it. To double check I when to the folder that I set as the path for the website in IIS Manager and they was a folder called app as excepted (when publishing I gave it website/app so I was excepting that folder) and it had a number of different files.
Edited
At first I was getting a blank page. After restarting my server, I now get a page with the message:
Error Summary
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
It tells me the most likely issue is that directory browseing is not enable but I would have though that my application would be access from the url (sb.website.com/app). The only files that publish copied over into that folder is the Web.config and Global.asax (it also copied the folder Areas, bin, and Views). Is there some setting in IIS Manager I am missing something else that should be copied over in the publish?
Figured out the issue.
I had to do was run aspnet_regiis -i in command line.
to start - Add a test.html page in your solution just to exclude any extension issues. Try even adding it to your wwwroot folder as well and see if you can hit it from localhost/test.html
Related
I have created the MVC5 code first Website on IIS and established the site with the Application pool in Live., then I did it manually. I did not publish my application, because the IT Network team do not know the publishing process. I uploaded as it visual studio files into live, users are registering live successfully but I saw so many examples are saying to publish the site, please suggest I have to publish my application is mandatory. And If I will keep my application like now into live any issue will come in futures.
There are multiple ways supported by Visual Studio to deploy an application. One of them is to publish it to local folder. You can publish your application to local folder, create a package and deploy it to hosting server.
I'm writing an ASP.NET Web Forms project in Visual Studio 2013, but am having trouble moving it to my computer's IIS 7. Although the project launches successfully from Visual Studio and works properly, launching the version I put on IIS gives an HTTP 500 error: "localhost is currently unable to handle this request."
Here is my process:
Use the File System method of Visual Studio's Publish tool to publish the project to a folder on my computer.
Access IIS' Default Web Site, and set the Physical Path to the folder I published the application to.
If the project works from Visual Studio, why wouldn't it work in IIS?
I had a double entry for in my web.config, and it was causing the same issue: 500 error with no other clue.
The problem was I was submitting a Web Form Application instead of a regular Web Site. The former has additional files in it that makes it not work properly in IIS (at least, I've never been able to make it work).
Thankfully, making a blank Web Site in Visual Studio and copying the web pages over from the Web Forms application was a simple matter, and I got it working easily.
I had an entry made in the web.config
which caused this error...remove the line fixed this issue. so probably any error in web.config makes the browser to not load the server and hence the issue
In advance, apologies for any improperly used terminology... I'm fairly new to web development/hosting, and IIS
I am trying to host a 64 bit ASP.Net 5 (MVC 6) web application, which uses beta 7, via IIS 7.5 on a windows Server 2008 R2 Standard machine.
I am publishing from Visual Studio 2015 (on a Windows 8 laptop) to a shared folder on the server. My IIS web application's physical path is the wwwroot folder created in the publish directory and the website seems to attempt to launch correctly...
Whenever the site attempts to run, however, I receive an error which states the following:
Unable to find the runtime directory 'D:\www\mysite\wwwroot\..\approot\runtimes\dnx-clr-win-x64.1.0.0-beta7'
Possible causes:
The runtime was not packaged with the application
The packaged runtime architecture is different from the application pool architecture.
The frustrating part is that if I copy and paste the link IIS claims it can't find and paste it into Windows Explorer, it leads me to a directory which does exist. That rules out the first explanation. As far as the second explanation goes, I have checked my publishing profile in Visual Studio and ensured that it is indeed the 64bit version of beta 7.
As far as I can tell, the proper runtime is sent with the published files, and they are the correct versions.
Is there anything I'm missing? The application runs fine in Visual Studio 2015. I don't know why when running on IIS it can't find a folder which not only exists, but is readily available to be browsed to.
UPDATE: I've continued to fight with this problem and found some odd symptoms... I can successfully make a website application from just about anywhere other than the D:\www folder. I stuck my site's published files container directly into the D drive and made a site directly from that, and it launched without a hitch. I was also able to replicate this on the C drive, and even placed the published files container into a folder called "wwww" in the D drive (so its physical path was D:\wwww\MySite\wwwroot as opposed to D:\www\MySite\wwwroot).
Does anybody know why "www" is problematic in particular? The folder structure in place here has several other (albeit much older) websites running from the www folder, so it's ideal that this application is placed in the same area. It seems like it works everywhere but there, however.
Any help is much appreciated!
For what it's worth, the solution I went with was to not place the application's publish folder in the D:\www folder. I ended up simply creating another folder in the root of the D drive and pointing the web application in IIS to that.
One of possible causes might be insufficient permissions for IIS user.
I added permission for approot (runtime) folder for IIS_IUSRS to read. Looks like IIS user was unable to read and load content of this directory because of insufficient permissions. After that it worked fine.
To learn more about .Net I created a website but now I want to learn how to Host it, in PHP I would just upload the files to the host and check everything how do I do this with a .Net website?
I have 2 Databases, Controllers, and Views.
I done some research and people said to just upload the files from the bin folder which I tried but it did not work, also tried just tried uploading the DLL files with no success.
Also tried uploading all the files from the project folder but it did not work.
Found a tutorial which right click the project and publish it so I tried publishing it to a folder and then uploading that but that did not work to.
To successfully publish and run your website on your host machine, the host machine must first have IIS (Microsoft's Internet Information Server) installed and running.
Once you have that in place there are several different approaches to deploy your website to the host. Here is a link to guidance from Microsoft's asp.net site in regards to "Choosing the Right Approach to Web Deployment".
Specifically, for you to be able to go "right click -> Publish" from within Visual Studio the relevant approach is "Web Deploy Handler (Publishing)" and you can find detailed instructions for setting it up in "Configuring a Web Server for Web Deploy Publishing (Web Deploy Handler)".
You just upload the files.
But you msut be sure that IIS is configured th acctually watch for a .NET app in the folder it loads in.
For normal we apps you did the right:
Also tried uploading all the files from the project folder but it did not work.
If it "just does not work" then it means .NET is just not there on that server or the folder you upload to is not configured to load a .NET project. Period. This is a fallback (technically you can upload less - the project file, i.e., is not needed), but it should work.
I'm deploying a site for the first time and after the initial upload of my files and a succesfull run through the site, I noticed that no further changes I was making to the CS files was making a difference on refreshes of the pages. I know i have to build my solution locally before seeing changes to CS, but i have no remote installation of visual studio on this server or anything, i'm just uploading files through FTP
what do I need to do? resetting IIS and editing the web config didn't help
It depends on the project type. Is it a web site or web application? Web sites dynamically compile (e.g. asp.net watches files and if .cs or .config files change, it will reload the site), web apps precompile into DLLs. It sounds like you have a web application though, so you'll have to deploy the DLLs instead of the cs files. In fact you do not need any cs files on your server in this case.
Just recompile locally, look in the bin directory of your web app, sort by last modified and you'll see the DLLs that get updated - these should get moved to the corresponding bin folder of your server