Visual Studio – Build – Warning – “The referenced component ‘Microsoft.Web.Infrastructure’ could not be found.”

Background

Downloaded a new Application.  One that I will have to build myself.

Launched Visual Studio and issued Build Command via menu.

Error

Ran into build errors.

The first one reads:

The referenced component ‘Microsoft.Web.Infrastructure’ could not be found.

Remediation

Have a lot of work to do this Saturday morning.

And, so let us address.

Package Manager Console

Running Visual Studio 2017 Community Edition, and the steps to access the Package Manager Console are:

  1. Navigate to the top menu
  2.  Menu Item
    • Tools
    • NuGet Package Manger
    • Package Manager Console

 

Install-Package

Code


Install-Package Microsoft.Web.Infrastructure

 

 

Output

Image

Textual
Attempting to gather dependency information for package 'Microsoft.Web.Infrastructure.1.0.0' with respect to project '[ProjectA]', targeting '.NETFramework,Version=v4.5.1'
Gathering dependency information took 120.25 ms
Attempting to resolve dependencies for package 'Microsoft.Web.Infrastructure.1.0.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Web.Infrastructure.1.0.0'
Resolved actions to install package 'Microsoft.Web.Infrastructure.1.0.0'
Retrieving package 'Microsoft.Web.Infrastructure 1.0.0' from 'nuget.org'.
Adding package 'Microsoft.Web.Infrastructure.1.0.0' to folder '<app>\\packages'
Added package 'Microsoft.Web.Infrastructure.1.0.0' to folder '<app>\\packages'
Added package 'Microsoft.Web.Infrastructure.1.0.0' to 'packages.config'
Successfully installed 'Microsoft.Web.Infrastructure 1.0.0' to <ProjectA>
Executing nuget actions took 5.42 sec
Time Elapsed: 00:00:07.5704133
PM> 

Credit

Crediting Joshua Davis per “FileNotFoundException: Could not load file or assembly ‘Microsoft.Web.Infrastructure“.  Here is the Link.

Joshua Davis’s about page is worthy of good, congratulatory read.  Here is the link to that page.

 

References

  1. NuGet.Org
    • Microsoft.Web.Infrastructure 1.0.0
      • This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically register HTTP modules at run time.
        Link
  2. fsprojects/Paket
    • Problem referencing Microsoft.Web.Infrastructure #1393
      Link

Visual Studio – Error – “Unable to find manifest signing certificate in the certificate store”

Background

Downloaded Source Code of an Application that I will be using, but unable to successfully compile it.

Error

Error Message

Error
Unable to find manifest signing certificate in the certificate store
Unable to find code signing certificate in the current user’s Windows certificate store.

Error Image

TroubleShooting

pfx file Missing

Solution Explorer

DiagManager

Image

Explanation
File Diagnosis
DiagManager_TemporaryKey.pfx DiagManager_TemporaryKey.pfx file is missing

 

Remediation

Project \ Signing

Uncheck “Sign the ClickOnce manifests

Summary

ClickOnce requires code signing.

As Microsoft is availing the Source code, they have opted not to include their PFX file.

References

  1. StackOverflow.com
    • Why am I getting “Unable to find manifest signing certificate in the certificate store” in my Excel Addin?
      Link

UML & Visual Studio

Background

My brother has a couple of Applications that he wanted to generate UML Models for.

And, so went online and downloaded both the Community ( Actual ) and Enterprise Edition ( Trial ).

 

Download

The latest version v2017, is available here.

Installed

Installed both versions.

And, was surprised that access to UML is no longer available under the Architecture menu.

Missed Functionality

UML to be ejected from Microsoft Visual Studio
Link

Not Supported post Visual Studio 2015 …

Stay with Visual Studio 2015

 

References

  1. Infoworld
    • Paul Krill
      • UML to be ejected from Microsoft Visual Studio
        Link
  2. Microsoft Developer Community
    • UML use case diagram in vs2017 RC Enterprise Edition
      Link
  3. Microsoft Developer Network
    • Create UML Class Diagrams from Code
      Link

Visual Studio 2010 – Upgrade from RTM to SP1

Background

Just as yourself, got a lot to do, but occasionally get pulled back in.

 

SQL Server 2008-R2 Upgrade

My manager has signed us up to upgrade all SQL Servers to the most recent version, 2016. Or at minimum the version that precedes the latest; btw, that is 2014.

The SQL Instance that I am looking at currently is v2008-R2 and the OS is 2008/R2.

That latest SQL Server supported on Windows 2008-R2 is SQL Server 2014.

 

Upgrade 2008-R2 to 2014

Trying to upgrade v2008-R2 to v2014, but ran into a constraint right away.

Features Rules

Textual

This computer has an installation of Visual Studio 2010 that requires a Service Pack 1 update that is needed for a successful installation of SQL Server based on your feature selection.

To continue, install the required Visual Studio 2010 Service Pack 1 from SQL Server media or from http://go.microsoft.com/fwlink/?LinkID=220649.

Image

Download Visual Studio 2010 SP1

Tried a drive by visiting https://www.microsoft.com/en-us/download/details.aspx?id=23691.

Redirected to https://www.microsoft.com/en-us/download/details.aspx?id=23691.

Download Visual Studio 2010 SP1 – Download 23691

Textual

We are sorry, this download is no longer available.

Image

 

Download Links

Source Link Works
go.microsoft.com/fwlink/?LinkID=220649 Link No
http://www.microsoft.com/en-us/download/details.aspx?id=23691 Link No
download.microsoft.com/download/E/B/A/EBA0A152-F426-47E6-9E3F-EFB686E3CA20/VS2010SP1dvd1.iso  Link  No
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5&displaylang=en Link  No
 my.visualstudio.com/Downloads?q=visual%20studio%202010%20service%20pack%201  ( All ) Link  Yes
my.visualstudio.com/Downloads?pid=2300 ( Visual Studio 2010 Service Pack 1 ) Link  Yes

 

Downloaded

Please download the online installer availed here.

BTW the link noted above is from my.visualstudio.com web site.

And, you need a registered user.

If you have yet to register for my.visualstudio.com, please do so.

It is a free.

 

Downloaded Results

Here are results that matches “Visual Studio Service Pack 1

Downloaded

Visual Studio 2010 Service Pack 1 – Details

File Specification

The file’s name is mu_visual_studio_2010_sp1_web_installer_x86_651694.exe.

It is a relatively small file, 795 KB.

It is an online installer and it is a bootstrap as it simply connects to the website and downloads the actual install media.

 

Install Visual Studio 2010 – SP1

Screen Shot

Welcome

Microsoft Visual Studio 2010 Service Pack 1 Setup

Installation Progress

Installation Is Complete

Microsoft -LightSwitch – Error – “Request Failed with Status Code ‘500’ and Status Text ‘Internal Status Error.'”

Background

From within Visual Studio, launched an application that I am developing using LightSwitch and received one of those hard to decipher error.

Error Message

Image

requestfailedwithstatuscode500

Text

Request failed with status code ‘500’ and status text ‘Internal Server Error’.

TroubleShooting

As I know so little about LightSwitch, I get petrified anytime I see an error.

Event Viewer

Took to the system’s event viewer and found the obvious problem.

Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult – System.ServiceModel.ServiceActivationException

Image

taskcategory_webhost_2017021_0445pm-cropped-up

Textual

WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/35567111
Exception: System.ServiceModel.ServiceActivationException: The service ‘/DBDiagData.svc’ cannot be activated due to an exception during compilation. The exception message is: Memory gates checking failed because the free memory (196927488 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.. —> System.InsufficientMemoryException: Memory gates checking failed because the free memory (196927488 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
— End of inner exception stack trace —
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
Process Name: iisexpress
Process ID: 2756

Tabulate

Product Version File Version
 Log Name Application
 Source System.ServiceModel 4.0.0.0
 Event ID  3
 Task Category  WebHost
 Level  Error
 Process Name  iisexpress

 

 

ASP.NET 4.0.30319.0 –  InsufficientMemoryException

Image

taskcategory_aspnet_2017021_0616pm-croppedup

Textual

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/21/2017 4:15:03 PM
Event time (UTC): 2/22/2017 12:15:03 AM
Event ID: a9e5abe2978940499d84b3ed7b2bc5a1
Event sequence: 34
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/2/ROOT-1-131321960967478001
Trust level: Full
Application Virtual Path: /
Application Path: C:\EDiag\bin\Debug\
Machine name: DADENIJI

Process information:
Process ID: 2756
Process name: iisexpress.exe
Account name: dadeniji

Exception information:
Exception type: InsufficientMemoryException
Exception message: Memory gates checking failed because the free memory (179412992 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

Request information:
Request URL: http://localhost:62496/Services/Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc/binary/GetAuthenticationInfo
Request path: /Services/Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc/binary/GetAuthenticationInfo
User host address: 127.0.0.1
User: dadeniji
Is authenticated: True
Authentication Type: Negotiate
Thread account name: dadeniji

Thread information:
Thread ID: 11
Thread account name: dadeniji
Is impersonating: False
Stack trace: at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

 

Tabulate

Product Version File Version
 Log Name Application
 Source ASP.NET 4.0.30319.0
 Event ID  1309
 Task Category  Web Event
 Level  Warning
 Process Name  iisexpress.exe

 

 

Remediation

Using Microsoft’s Task Manager close some of the Applications and Processes that are sagging memory.

Our target is to get more than 5% memory available.

Deploying LightSpeed Application – Web Platform Installer

Background

I need to deploy a small application that I placed together to pilot Microsoft Lightswitch.

We will be using Beth Massi’s “Deploying Lightswitch Applications to IIS 6 & Automating Deployment Packages” as a guide.

BTW, that excellent tutorial is here.

 

Web Platform Installer

Overview

  1. Microsoft Web Platform Installer
    • v5.0
      • Support Operating Systems:- Windows 8, Windows 7, Windows Vista SP2, Windows XP SP3+, Windows Server 2003 SP2+, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012.
      • Date Released :- 2/14/2013
    • v4.6

 

Download

To download the full blown installer, please go here.

As of today, 2016-Oct-13, here are the files that are currently available.

Links

Product Version x86 x64
 WebPI 5.0  Link – v5.0 – x86  Link – v5.0 – x64
 WebPI 4.6  Link – v4.6 – x86  Link – v5.0 – x64

 

 

Download & Installed

v5.0

As our box is an old x86 box, downloaded v5.0 x86 version.

 

Usage

From the Start menu, looked for “Web Platform Installer” and initiated it.

 

Error

Unable to download Product List
Image

unabletodownloadtheproductlistfrom

Textual

Unable to product list from .  Check your network connection and try again.  If the problem persists, report the use on the Web Platform Installer 5.0 forum at …

 

Remediation

Courtesy of

Superdoods @ Rackspace
Link

Launch regedit, navigate to the HKLM\Software\Microsoft\webplatforminstaller branch and add ProductXMLLocation to the

  1. Open regedit
  2. Navigate to HKLM\Software\Microsoft\webplatforminstaller
  3. Create a new string value

 

As we are going with the latest Web Platform Installer, v5.0, we went with the registry entry for 5.0

 

Before Registry Entry – v5.0

productxmllocation-before-20161212-1059pm

After Registry Entry – v5.0

productxmllocation-v5-20161212-1101pm

Restarted

Stopped and restarted Web Installer Platform and no more error message.

 

Deprecated

Unfortunately, LightSpeed Runtime is no longer bundled with v5.0, and so NO GO.

 

v4.6

Went back and downloaded v4.6 version.

Usage

From the Start menu, looked for “Web Platform Installer” and initiated it.

 

Search for Products

Search for Visual Studio LightSwitch…

And, we matched on

  1. Visual Studio Lightswitch 2011 Server Runtime without Local SQL
  2. Visual Studio Lightswitch 2011 Server Runtime and Local SQL

visualstudiolightswitch-searchresults

Add Products

As we have a remote SQL Server backend, we chose the “Visual Studio Lightswitch 2011 Server Runtime without Local SQL” option.

 

Prerequisite
Prerequisite – Image

visualstudiolightswitch-prerequisite

Prerequisite – Tabulate
Product File Size Link
 Visual Studio LightSwitch 2011 Server Runtime without Local SQL 1 MB
 Web Deployment Tool 1.1  5.01 MB  Link
 SQL Server 2008 R2 Management Objects  (x86) Only [ ENU\x86\SharedManagementObjects.msi ]  10.42 MB  Link
 SQL Server Native Client [ SQL Server Native Client 10.5 ]  4.49 MB  Link
 Microsoft System CLR Types for Microsoft SQL Server 2008 R2 (x86) [ ENU\x86\SQLSysClrTypes.msi ]  3.31 MB  Link

 

 

Prerequisite – Install Manually

If you will like to install the prerequisite yourself, please go here.

Please make sure that you are looking for the v2008 R2 version.

details

 

Installation
Installing…

install

Installing – Completed

installation-complete

 

Installing – Restart Completed
Image

restartcomputer

Textual

SQL Server Native Client 10.5 has finished installing successfully but requires a computer restart.
Do you want to restart your computer now? Click yes to restart now, or click no to close Web Platform Installer 4.6 and restart later.

 

References

Support

  1. Manual fix for a broken Web Platform Installer that cannot pull the packages from the Microsoft online package repository
    Link
  2. PLEASE READ: WebPI direct download links
    Link

QA

  1. Where to get Visual Studio LightSwitch 2012 Server Runtime from in Web Platform Installer?
    Link

LightSwitch – Simple table with a couple of referenced support tables

Background

One of the common “Beginner go to” Applications is a simple table that has Foreign Key relationships to a couple of Lookup tables.

Let us see whether Microsoft Lightspeed makes short walk of it or whether it stumbles.

 

Data Model

Diagram

Admittedly, it is an awkward looking Diagram.

DataModel

 

But, hopefully it is easy enough to follow with four entities.

 

Entities

Entity Use Content
listofServers lists all of our servers HRDB, HRWeb, mail gateway
listofApplications List the few applications that we support HR, Sales, Marketing
listofServerEnvironment Dev, QA, Test, Performance, and Prod
listofApplicationServers Joins the aforementioned entities

 

Foreign Key

Let us use sp_fkeys to get the foreign keys defined on our table.

Syntax


exec sp_fkeys
         @fktable_name = [table-name]
       , @fktable_owner = [schema-name]

Sample


exec sp_fkeys
         @fktable_name = 'listofApplicationServers'
       , @fktable_owner = 'dbo'

Output

sp_fkeys__listofApplicationServers-20161117-0940PM

Explanation

  1. We have declared three foreign key relationships
  2. The first one listed is FK_listofApplicationServers_listofApplications
    • The join is on ApplicationID
  3. The second one listed is FK_listofApplicationServers_listofServerEnvironment
    • The join is on serverRole (listofApplicationServers) to EnvironmentID ( listofServerEnvironment )
  4. The third one listed is FK_listofApplicationServers_listofServers
    • The join is on serverName
    • But, there is an important different between this join and on our other joins
    • This join does not target our Primary Key
      • Please take a look at the last column ( PK_NAME )
      • The first two joins targets PK_listofApplications and PK_listofServerEnvironment
      • And, the last targets IX_listofServers_ServerName
        • The reason is that the PK on dbo.listofServers is a serverID and not serverName
        • We chose to introduce serverID as a firewall against server name changes

 

 

LightSpeed

Once we are in light speed we will quickly go to work.

 

Data Source

Attach Data Source Wizard

Choose your Database Objects

 

AddDataSource-20161017-0703PM

 

 

 

LSML Files

listofServerEnvironments

Diagraming

Here is what our lsml display of the listofApplicationServer entity looks like

listofApplicationServer-lsml-20161117-0651AM

 

Explanation
  1. Our Primarky key is a composite key
    1. And, it has ApplicationID, serverName, and serverRole has the columns in the composite
  2. There are two additional properties
    • And, those are listofApplication and listofServerEnvironment
    • They allow us to map many-to-one  to our support tables ( listofApplication & listofServerEnvironment )
  3. A careful observer will not that our join to listofServers is missing. Why?

 

Add Relationship

By clicking on an empty spot in the panel, we can initiate the “Add Relationship”  option

    Add New Relationship – Begin

AddNewRelationship-20161118-0622AM

 

 

    Add New Relationship – In Process

Here we attempt to tie the listofApplicationServer table to the listofServer table

AddNewRelationship-InProgres-20161118-0720AM

 

But, we get an eror message that reads:

Image

RelationMustBeMappedOnTheKeyFields

 

Textual

The relationship must be mapped on the key fields and only the key fields of the primary side of the relationship.

 

Screens

Next thing to do is to setup the Screens.

Doing so involves deciding which screens are needed and customizing the default layout design of each screen.

 

Add New Screen

Let us Add New Screen …

 

AddNewScreen-20161119-0809AM

 

 

Explanation:

  1. Screen Sheet Name
    • ManageApplicationServer
  2. Screen Data
    • Syntax
      • DataSourceName.DataSetName
    • Sample
      • DBDiagData.listofApplicationServer

 

 

Layout – Default

 

Browse

Here is the layout of the Browse Screen

BrowseManageApplicationServers=-20161119-0811AM

 

Explanation
  1. Our three primary columns are displayed in the Browse Screen
  2. And, so for each each record we have our key columns display
  3. This makes it easy for specificity in row selection
  4. BTW, the key columns are Server Name, ApplicationID, and Server Role

 

 

 

View

Here is the layout of the View Screen

ViewManageApplicationServer-20161119-0811AM

 

Explanation
  1. The layout is two rows displayed horizontally
  2. And, all columns are displayed

 

Add Edit

AddEditManageApplicationServer-20161119-0812AM

 

Explanation
  1. This is same the screen design as the View Layout
    • The layout is two rows displayed horizontally
    • And, all columns are displayed

 

 

HTML Client

When we run the uncustomized application, here are the screens generated.

Browse

HTML Client display of the Browse Screen

Browse-20161119-0815AM (brushed up)

 

Explanation
  1. Our three primary columns are displayed in the Browse Screen
  2. And, so for each each record we have our key columns display
  3. This makes it easy for specificity in row selection
  4. BTW, the key columns are Server Name, ApplicationID, and Server Role

 

 

 

View

HTML Client display of the View Screen

View-20161119-0816AM ( Brushed up)

Explanation
  1. The layout is two rows displayed horizontally
  2. And, all columns are displayed
  3. Both the id and literal columns are displayed for columns involved in Foreign Key relationships

 

Add Edit

Here is what is rendered in the Add/Edd HTML Client

AddEdit-Edit-20161119-0819AM (Brushed up)

 

Explanation
  1. All columns are displayed
  2. For the columns involved in Foreign Key relationships both the id and the literal columns are displayed
    • For example
      • The Application ID ( 1 ) and the Application Name ( –PAS ) are displayed
      • The server Role ( 1 ) and Server Environment ( Production ) are displayed

 

 

 

Layout – Revised

 

Browse

Here is the layout of the Browse Screen

BrowseManageApplicationServers-20161119-0825AM

 

 

Explanation
  1. As stated earlier, we kept the identifying parameters
  2. To make them easier to read and identify, we replaced the system ids with their actual literal companions
  3. For record keeping, we did not remove the original system identifiers, we are merely hidden them

 

View

Here is the layout of the View Screen

ViewManageApplicationServer-20161119-0831AM (brushed up)

 

Explanation
  1. We kept the same layout and data has the Browse screen
  2. We could have added more data here, but for this particular entity the other  columns are timestamp tracking columns

Add Edit

 

AddEditManageApplicationServer-20161119-0834AM

Explanation
  1. Again, we kept the same data
  2. The entity we are addressing is a join table and not a user table

 

HTML Client

Now we will run the applicaton post touch up…

Browse

HTML Client display of the Browse Screen

Browse-20161119-0823AM (brushed up)

 

 

Explanation
  1. Again, our three primary columns are displayed in the Browse Screen
  2. But now not just the system ID, but the descriptive literals

 

 

View

Here is the HTML Client display of the View Screen.

We declutter it so that it only has data that we need.

 

View-20161119-0840AM (Brushed Up)

 

Add Edit

Here is what is rendered in the Add/Edd HTML Client

AddEdit-Edit-20161119-0839AM (Brushed up)

 

Explanation
  1. Again, we only have the columns that are needed
  2. And, those the Server Name, Application, and Environment

 

Summary

LightSpeed allows us create simple screens that supports entity and referenced columns.

Unfortunately, though it supports referenced Primary keys, it does not support candidate keys.