Publish a Website with IIS from Visual Studio 2012



okay so in this video we're going to use I is to publish a website from visual studio we're going to need a few things here first of all we're going to have to create a directory where our published files are going to sit so I've opened up my PC this is just my partition where I filed on I'm going to create a new folder here which I'm going to call the test site one and this is gonna be the directory where my publish files will sit the next thing I'm going to do now is I'm going to open up there I is in from Internet Information Services Manager on over on this as an administrators and a right click on this and run as administrator it's asking me if I want to update it which I'm not going to at this stage so just to maximize this this is the I is landing page on this left-hand side I can see my laptop and I can see my existing sites which I've got a default website as standard in there which he started and he's running on boards 80 what I'm going to do for now is I'm going to stop this default website the reason why I stopped these and I'm going to reuse this port 80 and I'll only get a message pop up saying that something else is using port 80 when I create my new site so I'll stop that for now I'm going to right click on site and add a new website which is going to be testing site 0 1 now the physical path is this folder I just created so I'm going to browse to that location for test site 0 1 I want to okay that you can see here we're using port 80 which is why I stopped my default site using port 80 otherwise I would have just got pop-up at this stage now click OK now it's saying is assigned to a new to a new site door want to duplicate it yes I do and we've got it drumming they're an exhort Amati started as test site zero one at this stage I'm just going to go into it I'm just going to make sure directory browsing is running which we can see there the fact that start is grayed out and stop is available that directory browsing DS and running so that's all we need to do on is it's really that simple now what I can do is I can open up visual studio and I can create a website that I want to publish the sake of this I'm just going to create an empty or a webform site let's stick to the same naming just to make it easy I'm gonna call test site by one and we're going to automatically create this website I know visual studio first repeated projects but it's a little website quite simply and so we're going to create this test site that would then going to publish in here we have our and web forms website running where I've got my about page contacts defaults etc what I'm going to do just for a bit of fun is if I on the default page let's go into design mode and and I'm just going to add something here so I'm going to do another button I'm going to drag a button on there let's give that a bit of length and I'm going to add a label and what I want this button to do is go changing the properties over here the text on the button to say I want is the time and and there we go and this is my label which we can see there is label one so when I click the button I wanted to show me the current time so to do that there's no double button and we get a button click event and Allah pop club just go type into here label one intellisense is already telling me these things we want the text to equal date/time now and that's going to be a string value so two string and there we go we've got our button handler now set and I'm just going to save this project now what I'm going to do is I'm going to publish this project so I'm going to go up to the build option here and I'm going to click on publish website now first things I do is create a profile so we're just going to select profile and we call it the test site I want and ones I'll stick to the naming okay and the publishing method is going to be a file system publication such as a publication and choose the target location and this is the location of the folder where we want to publish to you see at the moment this folder is empty this is going to filled with my published website so I'm just going to direct this now to this folder and I can go ahead and publish we don't need to worry about the extra settings here we're just going to go ahead and publish in our output we can now see visual studio running the publication and it says published one succeeded zero fails the are skipped our website is now published and we can go ahead and close that down if we come back to is we can now see in a test site one all those files are now appearing we can go ahead and minimize that and finally if I now open up my browser and direct this browser to HTTP colon slash slash the localhost we have now got to our published website with this extra button and label that we added which if I click on it the button click event tells me the time now so you can see this video was made on the 12th of the 12 at 10:00 to 4:00 and that's it that's all you really need to know about publishing websites using visual studio and using Internet Information Services Manager I hope that's been of use

24 thoughts on “Publish a Website with IIS from Visual Studio 2012

  1. Sir can u fix when i tried publishing the site the result is "publish failed object reference not set to an instance of an object"

  2. localhost – /HarishApplication/
    [To Parent Directory]

    3/22/2018 5:35 PM <dir> bin
    3/22/2018 5:35 PM <dir> CIVIFile
    3/22/2018 5:35 PM <dir> Content
    3/22/2018 5:35 PM <dir> CSFile
    3/22/2018 5:35 PM <dir> ECFile
    3/22/2018 5:35 PM <dir> EEFile
    3/22/2018 5:35 PM <dir> fonts
    2/27/2018 9:52 PM 112 Global.asax
    3/22/2018 5:35 PM <dir> Glyphicon
    3/22/2018 5:35 PM <dir> IFile
    3/22/2018 5:35 PM <dir> Image
    3/22/2018 5:35 PM <dir> Library
    3/22/2018 5:35 PM <dir> MECFile
    3/22/2018 5:35 PM <dir> Scripts
    3/22/2018 5:35 PM <dir> Views
    3/22/2018 5:35 PM 3510 Web.config

    getting this type of file in browser
    how to overcome it

  3. thank's for your video tutorial sir..
    very very simple and very very helpful to me..

    terimakasih atas video tutorial mu..
    sangat sangat simple dan sangat sangat membantuku..

  4. How do you deploy/publish/copy to an actual site?  Been testing on my local all day, now I'm ready to publish to a remote web server.  When I try to access the site, it keeps stating "file not found".  However, the files are there.

  5. can you also make a video on how to setup IIS smooth streaming with silverlight. most of the google searches didn’t made any sense on that topic.

  6. Thank you for this video tutorial. This is simple to do. I was trying to publish to godaddy but I see finally how IIS is another good way to publish my website.

Leave a Reply

Your email address will not be published. Required fields are marked *