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!