Tuesday, December 24, 2013

Creating a VSIX Project Template using Visual Studio 2013

If you are interested in creating an installable Project Template for your team members, you can accomplish this through creating a VSIX Project.  The major benefit of creating an installable Project Template is that you do not have to worry about instructing your development team members on where to place the project template files on their file system.

Before you can get started with creating project templates so that they can be packaged into a VSIX project, you will need to install the Visual Studio 2013 SDK which can be downloaded from here: http://www.microsoft.com/en-us/download/details.aspx?id=40758

Once you have done that, you can follow the instructions to export a project template here: http://msdn.microsoft.com/en-us/library/xkh1wxd8.aspx

Finally, you can then proceed with packaging your Project Template by following the instructions in this article: http://msdn.microsoft.com/en-us/library/dd885241.aspx

If you wish to construct a nested Project Template path for your VSIX project, you need to re-create the appropriate folder structure in your VSIX project (you need to emulate the same folder structure that Visual Studio uses as found in this path: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ProjectTemplates)




Then, when you install the VSIX package, it should appear in the structure you created as follows:


Monday, December 23, 2013

Upgrading ASP.NET MVC 4 projects to ASP.NET MVC 5

As you may know, ASP.NET MVC 5 support was released with Visual Studio 2013.  However, what if you have an ASP.NET MVC 4 project?  How do you go about upgrading to ASP.NET MVC 5?

Well, fortunately, the process of upgrading your ASP.NET MVC 4 project to ASP.NET MVC 5, though not completely automatic, is relatively simple.

First of all, you will need to upgrade the MVC assemblies in your project to ASP.NET MVC 5.  You can accomplish this through updating MVC in a NuGet package as shown in the screenshot below:


Once you have upgraded your MVC assemblies, you will have to do a bit of manual editing:


  1. You will have to edit both the Web.config file in the root of your Web project as well as within the Views folder.
  2. All references to System.Web.WebPages, System.Web.Helpers, and System.Web.WebPages.Razor will have to be updated to version 3.0.0.0
  3. All references to System.Web.Mvc have to be updated to version 5.0.0.0
If you now launch your MVC Web Application project and it launches without any Web.config error messages regarding incorrect assembly versions, you have successfully upgraded your project to ASP.NET MVC 5!!


Scaffolding with ASP.NET MVC 4 and Entity Framework 6

If you are currently using ASP.NET MVC 4 and are planning to upgrade to Entity Framework 6 within your solution, you should know about an issue regarding Scaffolding with MVC 4.

When I attempted to scaffold an MVC Controller in my project using Entity Framework 6, I got the following error message:


The link in the dialog box refers to the following online article: http://support.microsoft.com/kb/2816241

Basically the article stated that you will have to upgrade to ASP.NET MVC 5 in order to use Scaffolding with Entity Framework 6!

Therefore, unless you are currently planning on upgrading your MVC project to the latest version of MVC, you cannot begin using EF 6.


Saturday, December 21, 2013

Using HTML5 Helpers in ASP.NET MVC

If you are working with ASP.NET MVC, even with the new HTML5 Data Annotations, you may be able to get controls such as the Telephone and Email Input controls to render as their appropriate types, but the additional attributes that you may want to attach to that control may still not render (such as the "placeholder" attribute).

Fortunately, however, there is a workaround solution that addresses these deficiencies in the native MVC Framework.

This can easily be addressed through a NuGet package which includes HTML Helpers specific for HTML5.

This can be added directly through NuGet in Visual Studio by selecting the MVC5HtmlToolkit depicted in the screenshot below:


Once you have installed this NuGet package, you will then have the ability to use @Html.Html5EditorFor templates which will allow you to inject additional HTML5-specific attributes into your MVC forms!



Wednesday, December 11, 2013

Configuring Windows 8 for Media Streaming


If you have a Media Streaming device on your network such as a DLNA device, you can stream media content directly from your Windows 8 computer to your media streaming device.

The process basically involves setting up Advanced Sharing with the Media Streaming device by first allowing the device on your network to access content from your PC and configuring the various folders you can use to share media content such as Pictures and Videos.


 

Tuesday, December 10, 2013

Internet Explorer 11 memory usage

With the release of Windows 8.1 and Internet Explorer 11, I decided to upgrade my Windows 8 system to Windows 8.1 and try my hand out on IE 11.

With other browsers such as Google Chrome and Mozilla Firefox, I have long been a HUGE fan of opening multiple tabs (as many as 40+) and leaving them open session after session of restarting the browser.

To be honest, I have always found IE to be one of the slowest browsers in the market despite Microsoft's claims to the contrary primarily because of its close ties to the Windows operating system thus causing dependencies in the Windows OS to slow down initial startup of the browser.

Well, with all of the claims that Microsoft has been making about IE 11, I decided to give it a spin and use it similarly to how I normally and regularly use alternative browsers such as Mozilla Firefox and Google Chrome.

Well, after using IE and keeping 19 tabs open, I noticed the memory usage reached a whopping 1 GB of memory!!

Here is a screenshot of Windows Task Manager showing the comparative memory usage between the various browsers:





So, if you are a heavy browser user that loves to keep multiple tabs open, IE 11 is definitely NOT the browser for you!!

Tools for developing with WiX

If you are new to WiX or have only heard of WiX, it stands for "Windows Installer XML".

This standard was created by Microsoft several years ago to simplify the process of developing Windows Installer (MSI) files and storing them in source control.

Because the underlying code is simply XML with a specific schema, you can use pretty much any text editor to develop WiX packages.

Of course, to begin developing with WiX, you will need to install the WiX Toolset which can be downloaded from here: http://wixtoolset.org/

Once you have installed this, you can begin developing your WiX packages from within Visual Studio and leverage Visual Studio's Intellisense while composing your WiX files.

Of course, if you are like most people, you probably prefer a UI similar to InstallShield or Advanced Installer in order to create and build these WiX packages.

Well, unfortunately, unlike Windows Installer companies of which there are many numerous tools (NSIS, InnoSetup, InstallShield, Advanced Installer, InstallAware etc.), there are only a handful of tools that provide a GUI/UI over composing WiX packages.

Several years ago, InstallAware released a tool called WiXAware that provided a very good UI for developing WiX packages, however, this product seems to have disappeared from the InstallAware website.

There are 2 other tools that I know of for developing WiX packages with somewhat reduced UI capabilities compared to WiXAware, but here they are:

Therefore, if you choose to foray into the world of WiX for developing your Windows Installer packages, these UI toolsets may aid you in reaching your goals.

Changes with MSBuild and Visual Studio 2013

 

I have been working with MSBuild for many years and as many people know, MSBuild has typically been located here: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

However, when attempting to build a Visual Studio 2013 project using MSBuild, I received the following error message:

The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Then after some research, I found this article: http://timrayburn.net/blog/visual-studio-2013-and-msbuild/

This indicated the the location of MSBuild moved to a new path here (for 64-bit version): C:\Program Files (x86)\MSBuild\12.0\bin\amd64\msbuild.exe.  (The path for the 32-bit version is C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe)

After changing the location of my MSBuild executable to this new path, and re-building using MSBuild, my build completed successfully!

Wednesday, December 4, 2013

Storing InstallShield project files in source control

One of the many benefits of storing files in source control is so that you have a version history of your files.  Another benefit is so that you can compare 2 files stored in source control for differences.

Well, by default, InstallShield creates projects in Binary format, thereby making it very difficult to perform any types of comparisons when these files are stored in source control such as Team Foundation Server.

Fortunately, InstallShield offers the ability to store these project files as XML format as well.

You can do this in the following manner:


  1. Open the InstallShield project
  2. Click on General Information in the navigation
  3. Under the Project File Format selection, select "XML"
  4. Save the project file.
  5. This will now store the contents of your project file as XML to make it easier for comparison in your source control repository.

In addition, if you looking to eventually migrate your InstallShield project to another tool such as InstallAware, InstallAware requires that your InstallShield project be in an XML format in order to support importing the project file.


Sunday, December 1, 2013

Differences between One ASP.NET MVC and ASP.NET MVC 4 Project Templates

As many of you know, Visual Studio 2013 began shipping a new template with .NET Framework v. 4.5 called "One ASP.NET".

This template basically allows you to pick and choose which ASP.NET Web Technologies you would like to use within your solution:


However, if you are used to the available MVC Templates that shipped with ASP.NET MVC 4 in Visual Studio 2012, you will notice that there are far fewer options to customize your MVC project!


Of course, you can still access these from beneath the Web-->Visual Studio 2012 section in Visual Studio 2013, but this is certainly one of the limitations with using the One ASP.NET Project Template.


 If you are looking to build an MVC Mobile Application, this is one definite project template that you will miss!

Saturday, November 30, 2013

Where are Windows Desktop Backgrounds stored?

If you are looking for the source location for the Windows Desktop Backgrounds/Wallpapers that are associated with each release of Windows, you can find these Wallpapers here:

C:\Windows\Web\Wallpaper

For an OS such as Windows 8.1, there are several subdirectories beneath it such as the following:


  • Flowers
  • Lines and colors
  • Windows

Friday, November 29, 2013

How to enable InstallShield LE for Visual Studio

If you are interested in using the free version of InstallShield called InstallShield LE with Visual Studio, you should know that it does not ship by default with Visual Studio.

In fact, if you go into Visual Studio and create a new project type under "Other Project Types" --> Setup and Deployment, you will only see an icon that says "Enable InstallShield Limited Edition":


The provided instructions will then simply take you to this link where you have to register to download InstallShield Limited Edition:  http://learn.flexerasoftware.com/content/IS-EVAL-InstallShield-Limited-Edition-Visual-Studio?lang=1033&ver=prem

Once you download and install the LE version, you will be able to create an InstallShield LE project:


Of course, you will need the serial number that you received when you registered your copy of the software, because InstallShield LE requires activation:




Only after InstallShield LE is successfully activated, will you actually be able to begin using it for developing InstallShield LE Setup and Deployment projects:


Thursday, November 28, 2013

InstallShield vs. Advanced Installer

I have used both InstallShield and Advanced Installer in the projects I have worked on, but for individuals or groups that are currently evaluating a packaging tool, I thought this article might be of use in comparing the 2 toolsets head-to-head.

Here is a list of the features that I will be comparing between the 2 platforms:


  1. Freeware versions/evaluation versions
  2. Project Types
  3. Ability to import project types from other packaging platforms
  4. Frequency of updates
  5. Dialogs and Theming
  6. Customizability
  7. Overall feature set
  8. Overall ease of use
  9. Technical Support
  10. Build automation support
  11. Overall value

  1. Both InstallShield and Advanced Installer offer Freeware versions as well as Evaluation versions.  InstallShield offers its freeware versions through Visual Studio in the form of InstallShield LE while Advanced Installer offers its Freeware version available directly through its website.  Both companies offer evaluation versions of their software platform through their website.
  2. Advanced Installer offers a much wider variety of project types than InstallShield hands-down--absolutely no question.
  3. InstallShield offers no visible way to import projects from other packaging tools while Advanced Installer offers the ability to import from Visual Studio Setup, Wix, Inno Setup, NSIS Script, WISE and even InstallShield LE!
  4. Advanced Installer updates their software platform every few weeks with bug fixes and new features, while InstallShield only releases their software in the form of service packs and brand new version releases.  Therefore, new features usually take 1 year or more to get incorporated into the platform.
  5. For Basic MSI projects, both Advanced Installer and InstallShield offer several themes to choose from to customize Dialogs.  However, Advanced Installer makes the customization process significantly easier, provides much more modern UI Dialogs, and a larger selection of color choices.
  6. In regards to customization capabilities, Advanced Installer is just much more customizable.  Most customizations can be done very easily and readily using Advanced Installer, while InstallShield usually requires you to jump through numerous hoops to accomplish the same task.
  7. Overall, the feature set provided by Advanced Installer is far superior.  In many cases I have found that Advanced Installer almost seems to take feature sets provided by InstallShield and makes them 10x better than what is offered in InstallShield and then provides it as part of Advanced Installer.  
  8. Once again, Advanced Installer shines in the area of overall ease of use.  Getting up and running in Advanced Installer even with moderately complex packages is so much better than InstallShield that using the capabilities of InstallShield in comparison is almost laughable.
  9. Both companies offer Technical Support through e-mail, but I have found in my own experience that overall Advanced Installer is much more responsive in a timely manner than InstallShield support.
  10. In the area of Build Automation, InstallShield clearly has an edge over Advanced Installer.  They offer a Standalone Build installer which can be used specifically for build machines/Continuous Integration servers, as well as offering a lot more functionality for specifying Path Variables and defining Property values throughout the IDE especially for functionality such as Dynamic Folders (Synchronized Folders in Advanced Installer) as well as providing extensive command line support and a rich COM-based API for accessing and manipulating nearly every property in an InstallShield package.  
  11. If you want a complete solution with minimal expense, Advanced Installer is definitely the tool of choice for you.  If you are a company that wishes to deploy your own update solution, you can achieve that very easily and readily using Advanced Installer while InstallShield requires you to subscribe to a monthly/annual subscription to publish updates through their hosted service.  
Therefore, the verdict of the 2 installation packaging tools is that Advanced Installer is the CLEAR WINNER!

So, if you have not already chosen an installation packaging tool for your organization, I would definitely recommend choosing Advanced Installer as your tool of choice.

Tuesday, November 26, 2013

Custom Action restrictions in 64-bit InstallShield packages

I was attempting to build a pure 64-bit installation package in InstallShield by altering the properties in the Template Summary field (located on the General Information window), and when I then attempting to build my installation package, I noticed the following error message:

"32-bit VBScript/JScript Custom Action must not be included in a strict 64-bit package."




Fortunately, there is an easy solution to resolving this error message and that is to set the "Use 64-Bit Scripting" flag on the VBScript Custom Action.


Therefore, if you forget to set this flag on any VBScript/JavaScript Custom Actions that you have, you will receive the 32-bit error message that I received.



Sunday, November 24, 2013

Problems while upgrading to Windows 8.1

I just recently upgraded to Windows 8.1 and I selected the setting for "Keep my Windows Settings and Personal Files".

Part of the Windows 8.1 Upgrade required me to go through the setup wizard once again to set up an account for Windows Live syncing as well as requiring a Wireless network connection (even though I was connected to a wired network). 

However, overall, the upgrade completely smoothly and seamlessly, but I knew that there was a good possibility some of my applications would stop working after the upgrade.

I encountered a few problems after my upgrade to Windows 8.1:

  1. The Classic Shell Start menu disappeared after upgrading to Windows 8.1
  2. Bridged networking in VMWare Workstation 10 stopped working after upgrading to Windows 8.1
  3. My HP Printer Network Driver had disappeared
  4. Some of the libraries that I had configured with alternate location mappings had disappeared
  5. Device sharing with some wireless network devices had also disappeared
  6.  
For Classic Shell,  I simply had to run a "Repair" on the installation in order to restore the Classic Shell Start menu on Windows 8.1.

For VMWare Workstation 10, I received the following error message when attempting to use any VMs with Bridged Networking:


When I looked at the list of available VMWare Services in the Services Control Panel, I found this:






Apparently, the VMWare DHCP and NAT Services had disappeared!

Therefore, I decided to run a "Repair" on the installation to see if I could resolve this issue:




After, the repair was complete, I reviewed the list of VMWare Services once again:



Fortunately, it looked like the VMWare DHCP and NAT Services were restored after the "Repair" operation.  When I subsequently attempted to start one of my VMs with "Bridged" networking, the VM started correctly.  Whew!!

Alternatively, you can try using the "Restore Default" option from the Virtual Network editor to see if this restores your VMWare NAT and DHCP services as well:

  1. From the Edit menu, select Virtual Network Editor
  2. On the Virtual Network Editor dialog, click on the button "Restore Default"
  3. This should attempt to reinstall the VMWare DHCP and NAT services.



That was it!

Good luck with your Windows 8.1 Upgrades!

Internet Explorer Automatic Version Upgrade

I just recently upgraded to Windows 8.1 and as you may have already read, Internet Explorer 11 ships with Windows 8.1.

After upgrading to Windows 8.1, I decided to check out the Help -->About Internet Explorer menu option to verify that I had been successfully upgraded to Internet Explorer 11.

Here is what I found on the Help dialog:


It seems that with the release of Internet Explorer 11, Microsoft is attempting to follow a strategy similar to what Mozilla Firefox and Google Chrome already follow of being able to provide automatic updates to versions of the browser!!

However, considering that Internet Explorer is an Enterprise Standard browser for most corporations/organizations, there is no telling how this will affect organizations that currently develop their web applications to support a particular version of Internet Explorer if IE 11 will constantly be updated to new versions (could we see an IE Version 30+ with this automatic version update feature???)

In any case, if you are a developer that supports Internet Explorer as one of your major browser platforms, this feature is definitely something you want to keep apprised of especially if the applications you develop are based on supporting certain versions of the IE browser platform.


 

InstallShield Developer Reference -- Getting Started with InstallShield

If you are new to using InstallShield, the easiest way to get started with developing a new InstallShield package is to use the Project Assistant.

The Project Assistant provides you with an easy wizard interface to get you up and running with the most common options required for creating and building an installation package.  While most installation packages will still require you to edit settings in Installation Designer, the Project Assistant will get you up and running with the most basic values to be used in your package very quickly:











In each of the dialogs, you will notice that in the left hand navigation there is an option to perform some easy customizations without having to go into Installation Designer.  Other links will take you directly into Installation Designer for editing those settings.

One of the most useful screens in the Project Assistant which cannot easily be modified through Installation Designer is the Custom Images Dialog available from the Installation Interview tab in Project Assistant:


This dialog allows you to select custom images for your dialogs to provide your own customized branding for your InstallShield package.  Below is the Help text associated with using these Custom Dialog Images (accessed by clicking the Help button from the Dialog Images dialog box):

Dialog Images Dialog Box

Use the Dialog Images dialog box to add an image (.bmp, .gif, .jpg, .jpeg, or .ibd) that you want to display on your installation’s dialogs.

Full Screen Image
Browse to a graphic file that will serve as the full-screen background for your exterior dialogs. Exterior dialogs are dialogs that appear at the beginning or end of the installation, including InstallWelcome and SetupCompleteSuccess (the final dialog upon successful installation). The full-screen image should measure 499 by 312 pixels.

Banner Image

Browse to a graphic file that will run across the top of interior dialogs. Interior dialogs, which appear between the first and last installation dialogs, include the LicenseAgreement and CustomSetup dialogs. The banner image should be 499 by 58 pixels.

Creating Windows Installer Logs in InstallShield

If you are using InstallShield and you need to create Windows Installer Logs in order to troubleshoot installation issues with the package, there are 2 major ways to create these Windows Installer Logs:


  1. From the General Information window, select "Yes" for the option to "Create MSI Logs"
  2. In the Releases window, click on the Setup.exe tab and specify "MSI Command-Line Arguments"

With option #1, you can select various logging switches to create the MSI Logs, however, there is no option to specify the location of the MSI Logs (even with the Custom MsiLogging value):



To understand what the different letters in the MsiLogging value means, you will have to review this article: http://support.microsoft.com/kb/223300

However, a brief synopsis of the various switches is here: 

The letters in the value field can be in any order. Each letter turns on a different logging mode. Each letter's actual function is as follows for MSI version 1.1:
v - Verbose output
o - Out-of-disk-space messages
i - Status messages
c - Initial UI parameters
e - All error messages
w - Non-fatal warnings
a - Start up of actions
r - Action-specific records
m - Out-of-memory or fatal exit information
u - User requests
p - Terminal properties
+ - Append to existing file
! - Flush each line to the log
x - Extra debugging information. The "x" flag is available only on Windows Server 2003 and later operating systems, and on the MSI redistributable version 3.0, and on later versions of the MSI redistributable.

"*" - Wildcard, log all information except for the v and the x option. To include the v and the x option, specify "/l*vx".

With option #2, you have more options in terms of how you want to handle logging, including specifying the location of the resultant Windows Installer log file:



In order to determine what options, you can use for building your Windows Installer Log File, you can leverage the help of the "MSI Command-Line Builder" from the Tools menu:


You can then select the "Log Settings" link in the navigation and review the various switches available for creating Log files:



Friday, November 22, 2013

Passing parameters to MSBuild

 

You may know that you can pass parameters to MSBuild to populate properties contained in a PropertyGroup.

Below is an example MSBuild file we can use for the purpose of demonstrating passing properties:

<?xml version="1.0"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
<PropertyGroup>
<AppPoolName />
<AppPoolVersion />
</PropertyGroup>
<PropertyGroup>
<PowerShell>C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe</PowerShell>
<ScriptFilePath>H:\Scripts\AddIISAppPool.ps1</ScriptFilePath>
</PropertyGroup>
<Target Name="Build">
<Message Text="This is the value of the parameters: $(AppPoolName) and $(AppPoolVersion)" Importance="high" />
<Message Text="$(PowerShell) &amp; $(ScriptFilePath) $(AppPoolName) $(AppPoolVersion)" Importance="high" />
</Target>
</Project>


 



  1. As you may know in MSBuild v. 3.5 and above, you can also nest PropertyGroup elements inside of Target element.  Unfortunately, if you do so, you will not be able to pass those external parameters to your MSBuild script.
  2. Also, when you are passing parameters to MSBuild, make sure that you do not send the last parameter with a trailing semicolon such as: /p:AppPoolName=TestAppPool;AppPoolVersion=v4.0;. 

    If you do so, you will receive the following error message:  


    MSBUILD : error MSB1005: Specify a property and its value.
    Switch: /p:AppPoolName=TestAppPool;AppPoolVersion=v4.0;

    For switch syntax, type "MSBuild /help"

    Therefore, instead, you need to pass the parameters in this manner to avoid that error message:  /p:AppPoolName=TestAppPool;AppPoolVersion=v4.0. 


Hopefully, these words of advice can help you avoid similar problems/issues while developing and testing your MSBuild scripts.

Thursday, November 21, 2013

Dynamically invoking commands in PowerShell

If you ever have to build a command to execute dynamically in PowerShell, this is a very good discussion thread on how to accomplish this: http://stackoverflow.com/questions/6338015/in-powershell-how-do-you-execute-an-arbitrary-native-command-from-a-string

It basically involves using the Invoke-Expression or iex command for invoking the command contained in your PowerShell string.

Therefore, you can build up your PowerShell command in a PowerShell string, and then simply invoke it using Invoke-Expression or the short form iex.

Here is an example script that simply executes a dynamic command to run MSBuild:
 
$MSBuildPath = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
$MSBuildFilePath = "H:\Scripts\RunPowerShell.proj"


$MSBuildCmd = "$MSBuildPath $MSBuildFilePath `"/p:AppPoolName=TestAppPool;AppPoolVersion=v4.0`""

Clear-Host
Write-Host $MSBuildCmd
Invoke-Expression $MSBuildCmd




 

Escaping double quotes in PowerShell strings

If you have to escape double quotes in PowerShell strings, the easiest way to do so is to escape them using the "`" (backtick character) in all your strings.

Therefore, if you have a very long string that requires inclusion of double quotes, you will have to include a ` character before the beginning of the string (the 1st double quote) and a final ` character before the final double quote.

Here is an example:
 
$IISCmd = "Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter `"system.applicationHost/applicationPools`" -name `".`" -value @{name=`"$AppPoolName`";managedRuntimeVersion=`"$AppPoolVersion`"}"

You can also use an IDE such as PowerShell ISE or PowerGui to make sure that the formatting of your final PowerShell string is correctly escaped, but at least this example should hopefully help you deal with these normally problematic strings!

Wednesday, November 20, 2013

Overloaded methods in Managed Code Custom Actions

I have been writing Managed Code Custom Actions for years and I have had to write both Immediate Execution Custom Action methods as well as Deferred/Commit Custom Action methods.

Well, rather than re-writing functionality based on the number of parameters and parameter types, I decided to try and overload some of the methods in order to more closely follow OOP practices in terms of class design.

As I soon learned, OOP principles do not work when it comes to creating Managed Code Custom Actions:

As it turns out, InstallShield does not support selection of Overloaded methods for Managed Code Custom Actions as is evident by the message "Overloaded methods cannot be selected".

Therefore, when writing your .NET assemblies to be used in Managed Code Custom Actions, make sure that you do not use overloaded methods otherwise these methods will be unavailable for you to use within your InstallShield projects!

Tuesday, November 19, 2013

Testing Business Requirements for .NET Applications

Most developers know that we can test our code through Unit Tests as well as through Regression Tests such as the use of Web Tests or even test the scalability of our application through Web Performance/Load Tests.

However, how do we test to make sure that the code that we have developed has met business requirements?

Well, business driven requirements testing is currently not provided directly by the Microsoft Visual Studio suite of testing tools, however, there are 2 other tools that fill in the gaps left by Microsoft.

  1. SpecFlow: http://www.specflow.org/getting-started/
  2. FitNesse: http://fitnesse.org/FitNesse

While SpecFlow focuses on "Pragmatic BDD for .NET" and therefore has a focus on the .NET platform, FitNess is a more generalized tool used for Acceptance Testing.

These tools can be used independently or in conjunction with each other to meet your needs since they both work a little bit differently. 

While SpecFlow offers deep integration with Visual Studio.NET through a Visual Studio Extension, FitNesse relies on a web server that utilizes a Wiki format to perform business acceptance testing.

Personally, I like to work entirely within the Visual Studio IDE, therefore, I highly prefer using SpecFlow, but like I stated earlier, you can choose whichever tool suits your needs.

If you want to download the Visual Studio 2013 extension for SpecFlow, you can either download it as a NuGet package or get the extension directly from the Visual Studio Gallery here: http://visualstudiogallery.msdn.microsoft.com/90ac3587-7466-4155-b591-2cd4cc4401bc

Generate Unit Tests is back in Visual Studio 2012/2013!

As you may recall, Visual Studio 2010 offered the ability to generate Unit Tests from a given block of code.

Of course, this was limited to the MSTest Unit Testing framework, therefore, when Microsoft released Visual Studio 2012, they decided to remove this capability since they began offering support for additional Unit Testing frameworks such as NUnit.

Well, fortunately, enough developers complained about losing that feature (several thousand, in fact), therefore, Microsoft finally decided to bring back that particular feature through an Extension in the Visual Studio Gallery!  The extension supports both Visual Studio 2012 and Visual Studio 2013.

You can download this extension here: http://visualstudiogallery.msdn.microsoft.com/45208924-e7b0-45df-8cff-165b505a38d7?SRC=Home


ASP.NET MVC Web Apps for SharePoint 2013

With the release of Visual Studio 2013, Microsoft has finally released support for developing ASP.NET MVC Web Applications for SharePoint 2013!

You can read more about how to develop MVC Web Apps for SharePoint 2013 using Visual Studio 2013 here: http://blogs.msdn.com/b/officeapps/archive/2013/06/26/office-developer-tools-for-visual-studio-2013-preview-released.aspx


Duplicating files using InstallShield

If you work with .NET applications, you may already be familiar with the need to duplicate .config files into multiple directories.

Fortunately, if you have the need to duplicate files (such as .config files), you can do that pretty easily using InstallShield.

On the down side, InstallShield does not provide a direct User Interface in Installation Designer to accomplish this, but rather, you must manually edit the DuplicateFile table in DirectEditor.

  1. Open up Direct Editor
  2. Click on the DuplicateFile table
  3. Click on the New button to add a new record to the DuplicateFile table
  4. At a minimum, enter the FileKey, Component and File values for the record.  The DestName and DestFolder fields are optional if you want to rename the file or transfer the file to a different folder that does not currently belong to an existing component within InstallShield.



Now when your InstallShield package runs, it will read the values out of the DuplicateFile table and appropriately duplicate the files on the file system for you!