Visual Studio 2015 installation "hangs"

Software: Visual Studio 2015 Enterprise

Feature: Windows Phone 8/8.1 Tools

Symptom: While installing Visual Studio 2015 with Windows Phone 8/8.1 tools option checked, the setup program will be stuck at "Visual Studio preparation" or "Installing Windows Phone 8/8.1 SDK" screen for hours with no sign of completion. Cancelling the setup at that point will goes back to another infinite wait.

Findings: Using Process Monitor, it seemed that the setup program was searching for a trn file in specific folders:

C:\Users\{user}\AppData\Local\Microsoft\ApplicationInsights\vstelAIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70

C:\Users\{user}\AppData\Local\Microsoft\ApplicationInsights\vstelf144292e-e3b2-4011-ac90-20e5c03fbce5


Although it's not throwing any error, the setup program was just running in infinite cycles. Probably someone forgot to set the max retry there. To fix that, I created an empty file called "a.trn" in the 2 folders above, and voila, the setup program suddenly can write logs to the folder, and complete the setup.


28. December 2015
Technology (0)

Configure a custom domain name in Azure App Service via A Record

To point your custom web domain name (in my case, www.usoup.com) to Azure websites (Web Apps) using A record, there are a few steps that you'll need to follow precisely, both from your domain registrar (in my case, Godaddy.com) and within the Azure Portal itself. This article describes the steps clearly:

https://azure.microsoft.com/en-us/documentation/articles/web-sites-custom-domain-name/

However, one thing rather confusing over here, is that the configuration didn't work exactly as it described. I'm using contoso.com to continue where the article left off, for illustration purpose:

HostRecord TypeIP Address or URLBehavior
@A (address)168.62.48.183works for browsing the site via "contoso.com"
wwwCNAME (alias)contoso.azurewebsites.netbrowsing the site via "www.contoso.com" will actually display "Error 404 - Web app not found." error from Microsoft Azure
awverifyCNAME (alias)awverify.contoso.azurewebsites.netThis is the additional requirement from Azure Web Apps, as explained in the original article. 
To make the "www.contoso.com" actually points to a working Web Apps site, we'll actually need to add another CNAME alias, as follows:

HostRecord TypeIP Address or URL
awverify.wwwCNAME (alias)awverify.contoso.azurewebsites.net
Then go back to the Azure Portal > {your web app} > Settings > Custom domains and SSL > Bring External Domains > Add "www.contoso.com" under Domain names. You should now notice 2 host names assigned to your site in the "Custom domains and SSL" tab: "contoso.com" and "www.contoso.com".


23. December 2015
Technology (0)

Moles Framework error: Missing Assembly Reference

Tool: Microsoft Moles Framework for Visual Studio 2010

http://research.microsoft.com/en-us/projects/pex/downloads.aspx

 

If your machine has higher .Net framework installed (eg, 4.5) while your project is built targetting lower .Net framework (eg, 3.5), Moles framework will throw this kind of error when generating the Mole assembly:

The type or namespace name 'AntiXssEncoder' does not exist in the namespace 'System.Web.Security.AntiXss' (are you missing an assembly reference?)

Resolution: Manually edit the “.moles” file to remove reference to higher version classes that doesn’t exist in the lower .Net framework.

Reference: http://research.microsoft.com/en-us/projects/moles/molesdev11.aspx

But, how exactly do we know which namespaces to be excluded? Easiest is to just run the build on the test project, look at the (huge) list of the error description similar to the above. It tells you exactly which namespace that is missing. Now, you just need to be creative to convert the error list from Visual Studio into the xml nodes in the .moles file. My personal favorite is copy to Excel, use Text to Column feature (delimited, single quote), then unique filter the namespace values, use concatenate function to construct the required elements, copy to .moles file.

Just in case, remember to eyeball check the resulting .moles nodes to see if there is anything not supposed to be there. After all, the Visual Studio error window may throw different errors.

19. November 2013
Technology (0)