{"id":198,"date":"2010-07-27T08:59:56","date_gmt":"2010-07-27T15:59:56","guid":{"rendered":"http:\/\/invertedsky.net\/?p=198"},"modified":"2015-08-02T08:42:50","modified_gmt":"2015-08-02T14:42:50","slug":"forking-solutions-in-visual-studio-2005","status":"publish","type":"post","link":"https:\/\/invertedsky.net\/?p=198","title":{"rendered":"Forking Solutions in Visual Studio 2005"},"content":{"rendered":"<p>[Most of the info here is deprecated and no longer applicable to Visual Studio 2005]<\/p>\n<p>The developers at Microsoft can&#8217;t program their way out of a paper bag. For whatever lame reason, they have never offered a way to fork a project in Visual Studio.<\/p>\n<p>The following was copied from another blog&#8217;s comment section.\u00a0 Giving credit the comment was written by &#8220;flapdash&#8221;.\u00a0 I have reformatted and corrected some minor errors.<\/p>\n<p><!--more--><\/p>\n<p>Here&#8217;s how I went about duplicating a C# solution&#8230;to make it easier, let&#8217;s call solution #1 &#8220;silver&#8221; and solution #2 &#8220;gold&#8221;:<\/p>\n<ol>\n<ol>\n<li>Windows Explorer: copy and paste &#8220;silver&#8221;&#8230;you will get &#8220;Copy of silver&#8221;. \u00a0Rename this new folder &#8220;gold&#8221;.<\/li>\n<li>Inside the &#8220;gold&#8221; folder, \u00a0open the silver.sln.<\/li>\n<li>Inside Visual Studio&#8230;in the Solution Explorer, right-click the Solution Properties and choose &#8220;Rename&#8221;. \u00a0Rename it &#8220;gold&#8221;. \u00a0Save the solution (it will be saved as &#8220;gold.sln&#8221;).<\/li>\n<li>Inside Visual Studio&#8230;in the Solution Explorer, right-click the Project Properties and choose &#8220;Rename&#8221;. \u00a0Rename it &#8220;gold&#8221;. \u00a0Do this for all of your projects inside the solution.<\/li>\n<li>Under each project, you will typically have items like &#8220;Properties&#8221;, &#8220;References&#8221;, &#8220;Forms&#8221;, etc. \u00a0For easier discussion, let&#8217;s talk about &#8220;Resources.resx&#8221;. \u00a0At this point, you will notice that, if you click on \/Properties\/Resources.resx in the Solution Explorer, the &#8220;Full Path&#8221; property will show &#8220;&#8230;\\gold\\silver\\Properties\\Resources.resx&#8221; &#8230; it still has the old &#8220;silver&#8221; in the path name. \u00a0This is because we just copied-and-pasted without VStudio knowing about it, back in Step (1). \u00a0What a pain it would be to update the &#8220;Full Path&#8221; property for each and every item! \u00a0Now, here&#8217;s my trick to make things a little easier&#8230;<\/li>\n<li>Close VStudio (you should have saved &#8220;gold.sln&#8221; from Step (3) above, so VStudio should just close with no prompts.<\/li>\n<li>Open &#8230;\/gold\/gold.sln using a **text editor**. \u00a0Now, just change the folder names inside gold.sln to match your new copied solution. \u00a0For example, inside gold.sln, you should see a &#8220;Project&#8221; section&#8230;change the paths in this section. \u00a0For this example, it would look something like this:<\/li>\n<\/ol>\n<\/ol>\n<p style=\"padding-left: 60px;\">Project &#8230; \u00a0= &#8220;gold&#8221;, &#8220;silver\\gold.csproj&#8221;<\/p>\n<p style=\"padding-left: 60px;\">(it still has the old reference to &#8220;silver)&#8230;now change the above to something like:<\/p>\n<p style=\"padding-left: 60px;\">Project &#8230; \u00a0= &#8220;gold&#8221;, &#8220;gold\\gold.csproj&#8221;<\/p>\n<p style=\"padding-left: 60px;\">Now, save gold.sln.<\/p>\n<ol>\n<li>In Windows Explorer, now rename the &#8220;gold\/silver&#8221; folder to &#8220;gold\/gold&#8221;.<\/li>\n<li>Now when you open gold.sln, the &#8220;Full Path&#8221; properties for the items are all updated properly to &#8220;&#8230;\/gold\/gold\/&#8230;&#8221;. \u00a0For example, Resources.resx Full Path is now &#8220;&#8230;\\gold\\gold\\Properties\\Resources.resx&#8221;. \u00a0So, VStudio did the monotonous work for us.<\/li>\n<\/ol>\n<p>Anyway, it is a pain in the rear that there is no super-simple way to duplicate and &#8220;fork&#8221; solutions like this&#8230;but the above was the simplest I could come up with.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Most of the info here is deprecated and no longer applicable to Visual Studio 2005] The developers at Microsoft can&#8217;t program their way out of a paper bag. For whatever lame reason, they have never offered a way to fork &hellip; <a href=\"https:\/\/invertedsky.net\/?p=198\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[44],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-technical","tag-visual-studio"],"_links":{"self":[{"href":"https:\/\/invertedsky.net\/index.php?rest_route=\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/invertedsky.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/invertedsky.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/invertedsky.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/invertedsky.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198"}],"version-history":[{"count":7,"href":"https:\/\/invertedsky.net\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":1873,"href":"https:\/\/invertedsky.net\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions\/1873"}],"wp:attachment":[{"href":"https:\/\/invertedsky.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/invertedsky.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/invertedsky.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}