Sharp Architecture 1.6 Template Installation in Visual Studio 2008

An innovative new approach to customer service from the team who create Sharp Architecture has seen them remove the documentation for installing on Visual Studio 2008. In fact they seem to have removed any useful documentation – even from the page history. The usual wiki just seems to consist of a few obscure FAQs now. This is apparently so they can focus on development for Visual Studio 2010 and not do boring stuff like telling us how to use their software; which is fine for them, but the rest of us without deep pockets and time to upgrade (also not documented) are left in difficulty when a new member of staff comes along.

So after a frustrating couple of days I have finally figured out how to do it and the steps are below. Skip steps 2-5 if you have MVC 2 already installed. If I have learnt anything from this it is to make notes of everything when using Open Source software.

  1. Close down all instances of Visual Studio.
  2. Rename folder C:\Program Files\Microsoft Web Designer Tools\VWD to C:\Program Files\Microsoft Web Designer Tools\Wibble
  3. Install Visual Studio 2008 Service Pack 1 from here: http://www.microsoft.com/download/en/details.aspx?id=10986
  4. Rename folder C:\Program Files\Microsoft Web Designer Tools\Wibble to C:\Program Files\Microsoft Web Designer Tools\VWD
  5. Install ASP.NET MVC 2 from here: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=22079
  6. Download the file SharpArchApplicationTemplate_1_6_VS2008.zip from here: https://github.com/sharparchitecture/Sharp-Architecture/downloads
  7. Rename the file downloaded in 6 to SharpArchApplicationTemplate.zip, then copy it to the Visual Studio 2008\Templates\ProjectTemplates\Visual C#\Web folder in your ‘My Documents’ area. Obviously create that folder if it doesn’t already exist. See note a) below.
  8. Download the file SharpArchitecture_1_6_FullSourceAndTemplates.zip from the same place as in 6.
  9. From the zip file downloaded in 8 extract the SharpArchApplicationWizard.dll file from the VisualStudioTemplate folder. Put it in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE.
  10. Open a command line prompt (in XP, Start button->Run->type cmd). Change directory to the folder in 9 by typing cd “C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE”.
  11. Run the following command – .\devenv /installvstemplates (the first dot is important). This should take about 30-60 seconds to complete depending on how many other templates you have installed.
  12. Start Visual Studio 2008. You should now be able to see the Sharp template in the template window when you create a new project (under Visual C#/Web).

a) (Additional note for step 7) This zip file seems to cause problems when creating a new project for some people, in which case you can also extract it from the zip file downloaded in 8 (VisualStudioTemplate directory), which so far seems OK.

Advertisements

ASP.NET MVC Input button not submitting in Internet Explorer

If you have a piece of code that disables your submit button when you click it, such as the following:

   <script type="text/javascript">

        function delCheck() {
            if (confirm("Are you sure you want to delete?") == true) {

                
                $('#btnSubmit').attr("disabled", "disabled");
                return true;
            }
            else
                return false;
        }
    </script>

<% using (Html.BeginForm("Delete", "MyController"))
   { %>
           <input type="submit" value="Submit" title="Submit" name="btnSubmit" id="btnSubmit" onclick="return delCheck()" /> 
  
<%} %>

Then you will find in MVC that this does not submit when the user is using IE. Internet Explorer does not seem to like the fact that you have disabled the button (this is the case up to IE8, I’ve not checked IE9). All other browsers are OK.

If you need to prevent the user pressing it again then try making it invisible instead, which seems to work OK.