Developer forum

Forum » Development » Setting up the local DW development environment around Visual Studio correctly?

Setting up the local DW development environment around Visual Studio correctly?

Mikkel Toustrup Olsen
Reply

Hello,

I have tried to get my mind around the following and can't really get any ideas on a best-practice method for this.

Prior to my development within Dynamicweb, I used to have my own local environment in Visual Studio, connected to my IIS and with a local database. At a point where the customer was to have insigt in the project for feedback/changes etc. I would publish my work to a public staging(semi-live) site, which was accessible to anyone. If changes was to be made, I would simply fix the changes in question and re-publish to the staging site again and so forth. I have to say, that many of these solutions were hosted in-house. Furthermore I had the lovely ability to keep track of my files via a version control software - which ensured me file history, diffs etc. and the ability for others to work on the same project as me, without having any concerns regarding overwriting files etc. since we all had our own local environment..

However, in Dynamicweb many of the solutions which I am working on, on a daily basis, are not being hosted in-house but external. We do have ftp connections to the different solutions along with RDP access, however, if I were to setup a local dev. environment like the before-mentioned what would then be needed? It bugs me a bit that I on a regularly basis, as it is, has to work directly on a customer's live site as my setup is now. And not to mention the ability of NOT having version control of files. This is a huge issue in my honest opinion.

Any input, ideas would be very much appreciated :-)

 


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Hi Mikkel,

 

One of the things I like to use is Microsoft's Web Deploy for Hosters (http://www.orcsweb.com/blog/gabe/how-to-install-webdeploy-on-windows-server-2012/) which you'll need to install on the server. Then from within Visual Studio you can publish your files to the production server, download the latest (if they have changed on the server) and compare your local files with the remote versions. Additionally, this enables you to use Source Control directly from within Visual Studio. To avoid bloat in TFS, I usually add separate projects for the Templates and the Items folder and optionally other folders you want to control. Here's a quick rundown of what you could do:

 

1. Install Web Deploy

2. Create a new blank solution in Visual Studio

3. Choose Add Existing Website and select the local Templates folder

4. Right-click the new site and choose Publish. Configure web deploy by entering the path of the server and use Files/Templates as the deployment path

5. Repeat 2-4 for each folder you want to control from within Visual Studio.

 

This doesn't solve the problems with the database, but it at least gives you a lot more control over your files.

 

Hope this helps and let me know if you need more info.

 

Cheers,

 

Imar

Votes for this answer: 1
 
Mikkel Toustrup Olsen
Reply

Hi Imar,

Thanks a ton for the great reply.

You are right, that it would give me a lot more control over my files - however as you mention, it does not solve the database issues unfortunately.

I see the point in only having x-amount of folder in the project to actually control file-version-wise and do the web deploy. As I understand it, visual studio supports webdeploy as it is and it's only the server which needs to have this component installed, correct?.

Regarding the database issues. As I understand it, the more heavy database stuff should be done directly via the appropriate modules. Newsletter categories, Item types etc. However, it would be awesome to manipulate with these data via the respective API's in code. I guess this would be accomplished by knowing the system names and such and write the code accordingly. I dont see any other way to get around this?(i might overlook something here..)

Do you use the above-mentioned example in practice? - and do you connect it with your IIS as well (locally) ? <--- DB issue as well, since they wont reflect each other.

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Mikkel,

Yes, VS supports this already, so you only need the hosting component on the sevrer. You'll need VS 2013 to publish web sites to Web Deploy if I am not mistaken (the free Express 2013 version also works).

And yes, I run IIS on my local machine, usually with a local database as well. Then I redo my changes on the production / test when I deploy the files. We initially start-off with a local database for the general site structure, turn that into the production site, and the manually update it from there. Quite a pain, but there isn't a good solution available today. The Data Integration Framework can be used for some data migration, but you still miss out a lot of the other database changes.

Cheers,

Imar

 
Mikkel Toustrup Olsen
Reply

Hi Imar,

Yeah, that was my thought as well - that all the database changes should be done manually. However, with SQL Management Studio and it's intellisense it can't be any easier, when doing manual updates that is (my opinon). But yeah, I see your point and practice as a valid example which I will take further :-)

Along with the webdeploy and its comparison - how will this work for more developers. We are using KILN as it is, and I'm using Tortoise HG for my tracking and stuff.. Is there any way it can be coupled into this - or is the webdeploy comparer seperate from anything else.

Thank you so much for your inputs and ideas!

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Web Deploy works between the server and the client and files can optionally be source controller. This means that anyone with VS and a publish profile can publish. From within VS, you can use any source control system you normally use. However, you need to make sure you have the correct files when publishing. Like normal, you need to make sure you get a latest from source control, optionally merged with the files from the production server if they get changed there as well. Usually, when working on the temlates, I get a latest from the production server and check in any changes, Then I make my changes, and just before I publish, I compare them with the production version to make sure they haven't been changed in the mean time.

 

Imar

 
Mikkel Toustrup Olsen
Reply

That makes sense :-)

Well, thanks for your input - they are very much appreciated!

Regards,

Mikkel

 
Mikkel Toustrup Olsen
Reply

Hello again Imar,

I'm having some issues when trying to publish to the IIS on the server -> from my local environtment that is..

Can you guide me on how to setup the publish profile in visual studio? - atm im having:

Server: servername or the IP - without any luck (error message - could not connect to remote computer, make sure web deploy is installed..)

sitename : name of the website from the iis 

username: the username which has granted access to publishing

pw: password

destination url: http://name-of-iis-website:80/

I did install web deploy on the server, do I miss anything? :)

Thanks

/Mikkel

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Are you at the tech conference? If so, we can look at this together....
 
Mikkel Toustrup Olsen
Reply

Sorry I'm not :-) Hope its a good one though.

But do you reckon there is anything I'm missing in the above mentioned example?

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Mikklel,

Attached you find the config XML from my Templates folder (in Files\Templates\App_Data\PublishProfiles) that shows how to configure it. I think the DeployIisAppPath is the key to getting this working.

If that doesn't help, can you post yours?

Imar

2014-03-07_13-12-53.png
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

BTW, at the Tech Conference it was announced that a future version of Dynamicweb will have a deployment tool to migrate apps / modules, files and data from one environment to another!

 

Imar

 
Mikkel Toustrup Olsen
Reply

Hi Imar,

Unfortunately I am not able to download your xml file, it seems to have switched location/or been removed.

However, my publishProfile is like:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>http://dwtest.local.novicell.dk</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <MSDeployServiceURL>https://81.95.242.131</MSDeployServiceURL>
    <DeployIisAppPath>dwtest.local.novicell.dk/Files/Templates</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>mto</UserName>
    <_SavePWD>False</_SavePWD>
  </PropertyGroup>
</Project>

 

however, the dwtest.local.novicell.dk is the browsable page on the server's IIS :)

 

 
Mikkel Toustrup Olsen
Reply

... and to follow up on your second post, yeah my department sent me a picture of the Deployment Tool agenda from the tech conference.

Looks pretty sweet, however as I understand it, it will be implemented in 8.5/8.6 in 6-12 months.. 

/Mikkel

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

And here's mine:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>http://www.mydomainname.com</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <MSDeployServiceURL>http://www.mydomainname.com</MSDeployServiceURL>
    <DeployIisAppPath>mydomainname.com/Files/Templates</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>domain\username</UserName>
    <_SavePWD>True</_SavePWD>
  </PropertyGroup>
</Project>

 

I see a few differences, including the DeployIisAppPath (which matches my Service URL) and MSDeployPublishMethod. How did you configure your Publish Wizard? Which deploiyment option did you choose \?

Imar

 
Mikkel Toustrup Olsen
Reply

Hi Imar,

Over the last year and a half we have tested different project structures (In VS) for our DW projects. We've setup webdeploy on our clients servers, and basically it works great for smaller changes (ad-hoc fixes) etc. 

However, I tried your above mentioned approach last night and I found that it might be a "better" solution. Could you maybepost a screenshot or something of the like of your VS structure (Templates folder is, as I read it, added as an existing website), Custom Code(added as a new project - e.g. DW 8 Custom Modules) and so on. Just to make sure I understand it correctly :)

What i did:

1. Created blank solution

2. Added existing website which points at my local templates folder - as I worked on my local IIS, with a local database I just did a simple File system publish to IIS Site/Files/Templates - worked perfectly

3. Added new project Custom Modules (just to have some DW custom code library in the solution)

4. Added another library (just a clean C# library project - not a Custom Modules project)

5. Set up file system publish for both libraries..

Is this the way you handle custom code deploy as well - though on development, test and production having web publish setup (not file system publish obviously) :)

Thanks!

BR Mikkel

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Mikkel,

I tried to answer this before my vacation but didn't get to it unfortunately. I flagged it and I'll look into it again when I get back in a few weeks.

Imar

 

 
Mikkel Toustrup Olsen
Reply

Hi Imar,

Sounds perfect, have a nice vacation :)

BR Mikkel

 

You must be logged in to post in the forum