Technical: Microsoft – SharePoint 2010 Administration Toolkit – SharePoint Diagnostic Studio – Error – Microsoft SharePoint is not supported with version 4.0.30319.18051 of the Microsoft .Net Runtime

Technical: Microsoft – SharePoint 2010 Administration Toolkit – SharePoint Diagnostic Studio – Error – Microsoft SharePoint is not supported with version 4.0.30319.18051 of the Microsoft .Net Runtime

Background

A week ago or so, I downloaded and installed a fresh copy of Microsoft SharePoint 2010 Foundation Services.

Upon installation everything worked well. But, it appears that as I played around with stsadm, I possibly messed up my install.

Introduction

As I tried to recover from the problem stated above, one of the tools that I discovered on the Net is Microsoft SharePoint 2010 Administration Toolkit; and the main component from that kit is SharePoint Diagnostic Studio.

In this post, I will list a specific problem we ran into upon trying to use that tool on an MS Windows 2012 box.

Error Message

Upon targeting the SharePoint Diagnostic Studio against my local MS Windows 2012 box, I am getting the message stated below:


Microsoft SharePoint is not supported with version 4.0.30319.18051 of the Microsoft .Net Runtime.

So it seems the that I have to get the Application to target a lower level version of Microsoft .Net:

Possible Fixes

Possible Fixes – Application Configuration File

To do so, I tried creating configuration files:

The configuration files will be placed in our target folder for “SharePoint 2010 Administration ToolKit”.  In our case, the target folder is “E:\Program Files\Microsoft\SharePoint 2010 Administration Toolkit”.

So we create a file that looks like the one below.  Our targeted file is named SPDIAG.EXE, and we will be adding .CONFIG to it and so we end up with SPDIAG.EXE.CONFIG.

The contents of our App Config file is shown below:

AppConfig

The key elements are that we un-checked v4.0, and list v2.0x as the lone supported and required runtime version.

But, still getting the same error. And, so I am getting a bit un-convinced that I am on the right path.  And, I really in need of a miracle here.

SysInternals – Process Explorer

Let us try out SysInternal’s Process Explorer and see what it says about our Application’s running environment.

Please start Process Explorer as a Administrator

Once SysInternal’s Process Explorer is up, look for the SPDIAG.EXE process.

Once you focus in on SPDIAG.EXE, you can transverse each tab and get specific sets of data:

SPDIAG.EXE – Properties – Image

ProcessExplorer-Image

SPDIAG.EXE – Properties – .Net Assemblies

ProcessExplorer-DotNetAssemblies

Explanation:

  • On the left tab, the Structure column shows that we are using CLR v2.0.50727
  • And, the right tab, specifically the Path column shows that the files are being sourced from “C:\Windows\assembly\GAC_64\mscorlib\2.000_ ” and “C:\Windows\assembly\NativeImages_v2.0.50727_64”

Conclusion:

So though SPDIAG is target CLR v2.x, we are still failing….

SysInternals – Process Explorer

Again running as an Administrator, launch Process Explorer and filter our tangential processes.

Here are pertinent events:

  • Operation:- RegOpenKey\
    Path :- HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\powershell.exe
  • Operation :- ProcessCreate
    Path :- C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Command line: powershell  -command “& {& ‘C:\Users\<computer-name>\Documents\SharePoint Diagnostic Studio\Server Extensions\RemoteInstall-ExtendedDiagnosticProviders.ps1’ <computer-name>}”
  • Operation :- ProcessStart
    Path :-
    Command line:
    powershell  -command “& {& ‘C:\Users\<username>\Documents\SharePoint Diagnostic Studio\Server Extensions\RemoteInstall-ExtendedDiagnosticProviders.ps1’ COMFORT}”
    Environment :

    
    =C:=C:\Windows\System32
    	=E:=E:\Program Files\Microsoft\SharePoint 2010 Administration Toolkit
    	ALLUSERSPROFILE=C:\ProgramData
    	APPDATA=C:\Users\<username>\AppData\Roaming
    	asl.log=Destination=file
    	CommonProgramFiles=C:\Program Files\Common Files
    	CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
    	CommonProgramW6432=C:\Program Files\Common Files
    	COMPUTERNAME=<computer-name>
    	ComSpec=C:\Windows\system32\cmd.exe
    	FP_NO_HOST_CHECK=NO
    	HOMEDRIVE=C:
    	HOMEPATH=\Users\<username>
    	LOCALAPPDATA=C:\Users\<username>\AppData\Local
    	LOGONSERVER=\\<AD Server>
    	NUMBER_OF_PROCESSORS=2
    	OS=Windows_NT
    
    

Here are the relevant screen-shots:

ImageFileExecutionOptions:

Looking to determine whether an ImageFileExecutionOptions are defined in the registry for PowerShell.exe

ImageFileExecutionOption

Process Create:

Reviewing what command line options are passed to Powershell.exe when the process is being created:

Here they are:

  •  -command “& {& ‘C:\Users\<username>\Documents\SharePoint Diagnostic Studio\Server Extensions\RemoteInstall-ExtendedDiagnosticProviders.ps1’ <computer-name>}”
  • So we have the name of the PowerShell script to invoke — RemoteInstall-ExtendedDiagnosticProviders.ps1

Process Create – Tab – Event

ProcessCreate

Process Create – Tab – Process

ProcessCreate-Process

Process Start:

  • The environment options details all the environment options that are either created a-new or passed along from the invoking-parent’s process

ProcessStart

Conclusion:

From the screen shot above, we can tell that that the lone argument that is passed to PowerShell is the -command argument.

Our required/supported CLR version 2 is not being passed along.

 

Overall Conclusion

As  SharePoint Diagnostic Studio predates MS Windows 2012 it rightfully does not consider the new PowerShell v3.0’s graceful ability to expose PowerShell v2.0 via command line arguments.

In later posts will discuss other failed attempts!

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s