Copied to clipboard

Flag this post as spam?

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


  • Ault Nathanielsz 87 posts 407 karma points c-trib
    Sep 21, 2017 @ 10:42
    Ault Nathanielsz
    0

    Visual Studio and Git workflow

    I think it should go something like this:

    1. I create a project in Visual Studio Team Services online
    2. I clone the empty repo locally
    3. I use Visual Studio to create a project, and use NuGet to install Umbraco
    4. I build Umbraco (SQl CE, no content/empty site)
    5. I edit .gitignore
    6. I commit
    7. Colleague uses Visual Studio to clone repo (from VSTS)
    8. Colleague builds website in Visual Studio
    9. Colleague gets to work

    Am I missing anything here?

    Specifically, should Colleague use NuGet to install an Umbraco package on their local machine? Or will all the needed files be part of the repo?

    I am a complete noob when it comes to working with Umbraco and git, so please forgive any elementary mistakes in this outline.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Sep 21, 2017 @ 12:04
    Kevin Jump
    101

    Hi

    My Additional steps for this (using uSync)

    6.1. Install uSync (install-package uSync)

    6.2. make sure the uSync folder is commited to the repo (usync/data)

    ....

    7.1 Colleague - alters values in web.config on first start

    <add key="umbracoConfigurationStatus" value="7.6.4" />
    

    So it looks like

    <add key="umbracoConfigurationStatus" value="" />
    

    Also remove the ConnectionString from UmbracoDSN connection

        <add name="umbracoDbDSN" connectionString="" providerName="System.Data.SqlServerCe.4.0" />
    

    8.0 builds website

    8.1 will be prompted to Install Umbraco

    (Customize - selects SQLCE - no starterkit)

    8.2 Site installs. - uSync will put any of your configuration from the repo into the site.

    8.3 if both using SQL CE - you can ignore the changes to web.config at this point (in fact the file should look near identical and may not even say there have been changes)

    9 . Colleague gets to work.

  • Ault Nathanielsz 87 posts 407 karma points c-trib
    Sep 21, 2017 @ 16:30
    Ault Nathanielsz
    0

    Thanks...

    I gave that a go, but step 8 is failing. I get a couple Errors and 63 Warnings on the build.

    Errors:

    1. The name 'model' does not exist in the current context
    2. 'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'Partial' and no extension method 'Partial' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

    Warning example (no need for all of them, I shouldn't think)

    • Unable to update auto-refresh reference 'automapper.dll'. Cannot find assembly 'C:\Users\UserName\Documents\Visual Studio 2015\Projects\umbraco.7.6.6.2017.09.21\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.dll'.

    Perhaps I should provide my steps here, and if anyone can spot any obvious errors... NB All steps are taken in VS.

    8.0 - Clone repo to local directory

    8.1 - File: Open Web Site... (From local files - I browse to the repo)

    8.2 - Save solution (in repo - not in default VS2015 folder)

    8.3 - In solution explorer: right-click the solution name and choose "build".

    (8.4 - watch Error list populate)

  • Ault Nathanielsz 87 posts 407 karma points c-trib
    Sep 21, 2017 @ 16:39
    Ault Nathanielsz
    0

    Addendum: by saving the .sln where VS expects it to be, I got rid of all the warnings. However, the two error messages remain.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Sep 22, 2017 @ 09:26
    Kevin Jump
    0

    Hi

    Usually I create a "web project" not a "web site" inside visual studio - there are some subtle differences, but one is that all the "umbraco" folders like umbraco, umbraco_client don't appear in your solution but are handled by config settings within the project.

    if you've created a Web Application in visual studio you shouldn't need to add the solution to visual studio like your step 8.1 your repo should have a .sln file that your developer can just open with everything they need already setup.

  • Ault Nathanielsz 87 posts 407 karma points c-trib
    Sep 22, 2017 @ 10:30
    Ault Nathanielsz
    0

    Kevin, That solved it. Thanks a bunch.

    One last question... does the colleague then commit their webconfig (edited in 7.1)? Or is this added to the gitignore (as I think you suggest (in 8.3)?

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Sep 22, 2017 @ 10:37
    Kevin Jump
    0

    if they have set it up the same as you (for example both local SQLCE) then the web.configs should actually be the same.

    you might see it as a change because the UmbracoDSN line moved, but if you check it - you might see that the actuall connection strings match.

    In that sense you can just 'revert' the changes made when the colleague setup there install, because the original web.config will have everything they need - so there would be nothing for them to check in once they had setup their version.

    if for what ever reason you have diffrent db settings (so say you run on SQLCE and your Colleauge is using SQL Express) then i would suggest moving the connection string out of the web.config and excluding that 'connectionStrings.config' using .gitignore

  • Ault Nathanielsz 87 posts 407 karma points c-trib
    Sep 24, 2017 @ 15:02
    Ault Nathanielsz
    1

    To anyone else who might want it, here is what worked for me (Visual Studio 2015)

    Creating a new (empty) Umraco site in Visual Studio and working with GIT

    1) Create a new project in Visual Studio

    1-a) File: New: Project

    1-b) In the next window:

    1-b-i) Visual C#

    1-b-ii) ASP.NET Web Application

    1-b-iii) Ensure create New Git Repository is checked

    1-c) In the next window:

    1-c-i) Choose Empty project

    1-c-ii) Ensure MVC is ticked.

    2) Use Nuget to install these packages into the project

    2-a) Umbraco CMS

    2-b) Usync

    3) Build Umbraco

    4) Edit .gitignore

    4-a) If there is none, add a text file to the project and name it ".gitignore"

    4-b) Paste the Visual studio gitignore code into the file (VS gitignore).

    4-c) Paste the Umbraco gitignore code into the file (Umbraco gitignore).

    5) Commit

    6) Publish repo to a git service (e.g. Visual Studio Team Services)

    6-a) Check to ensure that /usync/data is in remote

    7) Pull repo onto new machine

    8) Edit web.config (to these empty values)

    8-a) key="umbracoConfigurationStatus" value=""

    8-b) name="umbracoDbDSN" connectionString="" (NB: keep provider name)

    9) Commit

    10) Build Umbraco on new machine

Please Sign in or register to post replies

Write your reply to:

Draft