Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andreas Pfanner 196 posts 314 karma points
    May 19, 2014 @ 17:06
    Andreas Pfanner
    0

    Hi,

    I am building a new Umbraco 7 site and I would like to build a Visual Studio 2013 development environment for it. I planned to create a new ASP.NET Web Application (empty) and add Umbraco using Nuget.

    I have a web server which hosts a test database instance (SQL Server) as well as the test website instance (IIS).

    I run the application from Visual Studio 2013 for development purposes on my local machine connecting to the remote test database. After I finished changes (stylesheets, templates,...) I would like to use the Visual Studio Publish feature to copy the changes to the remote web site (dev instance) using WebDeploy.

    Any experiences on such a scenario? Are there any drawbacks when using Publish/WebDeploy? How would you then populate changes from the test environment to the live environment? Is Umbraco Courier required, or can that also be done using Publish from within Visual Studio (and manually add things like Document types to the live database)?

    Best Regards Andreas

  • William Wilton 3 posts 22 karma points
    May 21, 2014 @ 13:47
    William Wilton
    0

    Hi Andreas,

    I am new to Umbraco, and have spent a day trying to get this approach to work. 

    My Laptop is Windows 7 and has VS2013 and I was connecting to a test database on a seperate SQL 2008 server. Then publishing to a different IIS server (2012 R2) running IIS 8. I am using Web Deploy 3.5

    The biggest issues I had with Web Deploy was that if Visual Studio and IIS were not run as Administrators it would appear to work, but then when I looked at the published result various things were missing or not working.

    I am logging onto all of the machines and publishing with the same account. It is a local admin on all machines

    Anyway my complete checklist of steps which resulted in success is as follows

     

     

    Dev Environment Setup

     

     

     

    1. Run Sequel Server Management Studio
      1. Create a new empty DB.
      1. Create a SQL user for DB with owner rights

     

    1. RUN Visual Studio 2013 AS ADMINISTRATOR
      1. Create empty web app project
      1. nuget umbraco cms (current version was 7.1 as of writing this)
      1. Run project without debugging in VS
      2. Configure Umbraco, select customize and link to the new DB with the new user
      1. Show hidden folders, include all in project except obj (2 to include in Views. 1 in Config)

     

    1. RUN IIS AS ADMINISTRATOR
      1. Create IIS website, set app pool, set port

     

    1. RUN EXPOLORER
      1. give app pool id full control on entire drive  -  (App Pool account in IIS8 is  'IIS AppPool\' and must be typed exactly and in full then checked for on the local machine)

     

    1. RETURN TO VS, REMEMBER MUST RUN VS AS ADMINISTRATOR
      1. In server explorer add a connection to the database you created
      1. Set up the publish profile Connection
      2. Set up the publish profile Settings, Remembering to set the Remote Connection string from the dropdown.
      1. Check remove additional Files at destination, and Exclude files from the App_Data folder
      2. Then hit Publish

     

      1. Finally I get an error to do with connection string parameterization…
      2. Add a file to the project called {ProjectName}.wpp.targets
      3. Paste the following into the file
      4. Save and close VS, Reopen RUN VS AS ADMINISTRATOR and publish the project. 

     

    xml version="1.0" encoding="utf-8"?>

    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

      <PropertyGroup>

       <AutoParameterizationWebConfigConnectionStrings>falseAutoParameterizationWebConfigConnectionStrings>

      PropertyGroup>

    Project>

    This fix is from http://blogs.msdn.com/b/webdev/archive/2010/11/10/asp-net-web-application-publish-package-tokenizing-parameters.aspx

     

     

    Hope that helps.

    Will.

     

  • Andreas Pfanner 196 posts 314 karma points
    May 21, 2014 @ 14:50
    Andreas Pfanner
    0

    Hi Will,

    thanks for your reply - nice to discuss about that in detail.

    I generally have set Visual Studio to run as administrator (by default). I am using IISExpress for the Umbraco solution (altough I have IIS installed), because I thought it would be easier with that in terms of running as a host name (localhost:ip) by default without virtual directories etc. in IIS.

    Do you publish the web application using WebDeploy to a production environment or to a remote test environment? I currently only deploy to a remote test instance (which is publicly available through the internet), so I don't have to change connection strings on publishing (yet). I also don't check the boxes at "File Publish Options". Btw: I wonder if its a good approach for publishing changes later to a production environment also.

    I also wonder what setting in project settings -> Package/Publish web is the best (actually I have set "Only files neede to run this application" (default).

    What I tested yet: I started the LOCAL Umbraco instance from Visual Studio (Ctrl F5) and installed a starter kit using the backend. After that I had to include all files added by the starter kit manually to the Visual Studio project (Include In Project - for all the CSS, Views,..). After that I published to my remote dev instance using WebDeploy, and it worked there too (same database). The only challenge here is to really catch all necessary files and add them to the project.

    Another general question: I guess you also work source controlled. Which folders of the Umbraco solution do you add to source control? What's best practice here?

    Best Regards Andreas

  • William Wilton 3 posts 22 karma points
    May 22, 2014 @ 11:34
    William Wilton
    0

    Hi Andreas,

    I am also running in IISExpress for development and testing.

    I am publishing using Web Deploy to a remote test environment, still connected to the same database. I am not sure what the best approach for "File Publish Options" is.I check remove additional files at destination to keep clutter down on the server, and I was getting errors publishing with Exclude files from the App_Data folder unchecked.

    I have not changed any of the Package/Publish web settings, they are default like yours.

    I have done the same with the Local Gov starter kit, deployed identically to yours, and had the same fun with finding all the files.

    Regarding source control, I am checking in the following, though doubt it is best practice... to be honest I do not knw enough about Umbraco to know what can be excluded from source control, thought I suspect the umbraco and umbraco_client folders could be a start.

    I have managed to get one of my colleagues to get the latest version, connect to the shared database and run his own development environment in VS/IISExpress on his local machine. So we can both work independently on our own laptops, check in and merge changes, then publish to the shared remote dev environment.

    I have not worked out the next step to deploy to live, I am thinking about looking at the uSync developer tool, it should write non-content database info to XML files that can be source controlled and shared/deployed.

    If I can get that working I should be able to use it to web deploy my changes to staging and then to live.

    Cheers, Will.

  • Andreas Pfanner 196 posts 314 karma points
    May 22, 2014 @ 12:48
    Andreas Pfanner
    0

    Hi Will,

    thanks again for your input and sharing your experiences. Seems that we have actually pretty the same goals and requirements ;) I didn't know uSync yet, but I will check that too!

    Can anybody answer what part of the application should / must be added to source control in order to allow other team members to run the application as well on their local machine? I wonder if the App_Data folder must be included at all!?

    Best Regards Andreas

  • Devon Sams 1 post 21 karma points
    Nov 25, 2014 @ 15:39
    Devon Sams
    0

    Hello Will and Andreas,

    I wanted to check in with you two to see if you could share anything new you have learned regarding this topic since your last posts. I just started a new job and will be working with umbraco. I'd like to have a local dev environment. I've made some progress with a Vagrant setup. I'm just wondering what I should commit to source control, how do I go about deploying my changes to our dev and prod servers, and any other useful tid bits you might have.

    Thanks

  • Richard Kingston 46 posts 69 karma points
    Nov 28, 2014 @ 21:22
    Richard Kingston
    0

    Hi all,

    This is something I would also be interested in - especially the part about what to commit to source control when working with NuGet - presumably only the specific development files.

    My intention is to open a new VS project, use NuGet to install the latest version of Umbraco and then basically .gitignore everything before I start developing in the App_Data folder.

    I read an interesting post on theoutfield.net that led me to that way of thinking.

    Would be good to know how you guys have got on since May.

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft