none
Unable to install SQL Server 2008 Express R2 after installing .NET 4.0

    Question

  • Hi experts,

    I intend to redistribute SQL Server 2008 Express R2 in my installer. I've extracted the setup files from SQLEXPR32_x86.exe and pass in the appropriate command line parameters during the setup.

    Recently, I noticed if I applied the following Windows Update: .NET 4.0 Client Profile, I will hit into the following error when I installed SQL express.

    .NET Runtime 4.0 Error Reporting

    EventType clr20r3, P1 setup100.exe, P2 10.50.1600.1, P3 4bb67524, P4 mscorlib, P5 4.0.0.0, P6 4ba1da6f, P7 44f0, P8 32, P9 system.security.security, P10 NIL.

    .NET Runtime

    Application: setup100.exe

    Framework Version: v4.0.30319

    Description: The process was terminated due to an unhandled exception.

    Exception Info: System.Security.SecurityException

    Stack:

    at Microsoft.SqlServer.Chainer.Setup.Setup.DebugBreak()

    at Microsoft.SqlServer.Chainer.Setup.Setup.Main()

    Running the setup.exe from a file server will give these errors but if I copied the entire setup files to a local folder and run setup.exe from there, it runs fine.

    May I know what am I missing? I definitely need to support to install SQL express running from a file server location.

    Thanks,

    MK

     

    Friday, August 13, 2010 8:34 AM

Answers

  • I read up some issues on System.Security.SecurityException and come across some article on legacyCASPolicy and loadFromRemoteSources elements.
    I did a search of the config files on the SQL setup files and found these files:

    setup.exe.config
    setup100.exe.config
    fixsqlregistrykey_ia64.exe.config
    fixsqlregistrykey_x64.exe.config
    fixsqlregistrykey_x86.exe.config
    landingpage.exe.config

    I updated the <runtime> element to disable legacyCASPolicy and added loadFromRemoteSources element to these files.
    Here are the changes:

    ...
      <runtime>
        <legacyCasPolicy enabled="false" />
        <loadFromRemoteSources enabled="true"/>
      </runtime>
    ...

    I tested the setup.exe and things seemed to run smoothly now.
    Are these changes correct?
    Or I might be breaking something else?

    Please advise.
    Thanks.

    • Marked as answer by Min Keng Monday, August 30, 2010 1:07 AM
    Wednesday, August 25, 2010 8:13 AM
  • Min,
    Thanks for your clarification.

    This issue is probably a compatibility issue caused by .NET Framework 4.0 Client Profile. You may try installing the full package of .NET Framework 4.0 on your computer first to see if it helps, http://www.microsoft.com/downloads/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7&displaylang=en

    If this issue persists, according to the following description in this article, http://msdn.microsoft.com/en-us/library/ms171868.aspx#application_compatibility_and_deployment

    "If your application or component does not work after .NET Framework 4 is installed, please submit a bug on the Microsoft Connect Web site. You can test compatibility as described in the .NET Framework 4 Application Compatibility topic and learn about new features by using the Visual Studio 2010 and .NET Framework 4 Walkthroughs. "

    I recommend that you submit a feedback to the product team at the connect website so that they can further investigate this issue and fix it as soon as possible. Currently you may just perform local installation of your SQL Server 2008 Express or postpone to install .NET Framework 4.0 Client Profile.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Tuesday, August 17, 2010 12:16 PM
    Moderator
  • Min,

    CAS may be the problem since it is a significant security change in .NET 4.0, however I think that these changes should not cause users to manually modify each config files for a setup. You may submit a feedback to report this issue to our product team and hope this issue will be fixed in future. Thanks.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Min Keng Monday, August 30, 2010 1:07 AM
    Friday, August 27, 2010 9:35 AM
    Moderator
  • Yes, I've sent the feedback to the product team.

    Thanks,

    Min Keng

    • Marked as answer by Min Keng Monday, August 30, 2010 1:07 AM
    Monday, August 30, 2010 1:07 AM

All replies

  • MK,

    If you are trying to install SQL Server 2008 from a remote file server, please make sure that you are using a domain user account which has read and execute permissions on the remote share according to this article, http://msdn.microsoft.com/en-us/library/ms144259.aspx

    Also make sure that you already installed .NET Framework 3.5 SP1 on your client before you install SQL Server 2008 R2 Express.

    If this issue persists, please let me know:
    Which OS of your client computer is?
    What is the windows update of the .NET 4.0 Client Profile?
    SQL Server 2008 R2 Express setup logs. You may first post the summary.txt in the folder %ProgramFiles%\Microsoft SQL Server\100\Setup Bootstrap\LOG

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Monday, August 16, 2010 10:25 AM
    Moderator
  • Hi Charles,

    I am using a domain user account that has both read and execute permissions on the remote share and .NET 3.5 SP1 is installed.

    I can reproduce the problem in both Windows XP and Windows 7 (x86 and x64 machines).

    Before I applied the following update, I can execute the SQL Server 2008 Express Setup.exe from the remote file server with no error.

    KB982670 - Microsoft .NET Framework 4 Client Profile

    But once the update is applied, I'm unable to execute the setup.exe from the file server. It will give me the following error:

    Managed SQL Server Installer has encountered a problem and needs to close.

    Microsoft SQL Server folder is not even created under %ProgramFiles% folder yet.
    The logging I provided earlier is from Event Viewer.

    Thanks n Regards,
    MK

     

    Tuesday, August 17, 2010 2:08 AM
  • Min,
    Thanks for your clarification.

    This issue is probably a compatibility issue caused by .NET Framework 4.0 Client Profile. You may try installing the full package of .NET Framework 4.0 on your computer first to see if it helps, http://www.microsoft.com/downloads/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7&displaylang=en

    If this issue persists, according to the following description in this article, http://msdn.microsoft.com/en-us/library/ms171868.aspx#application_compatibility_and_deployment

    "If your application or component does not work after .NET Framework 4 is installed, please submit a bug on the Microsoft Connect Web site. You can test compatibility as described in the .NET Framework 4 Application Compatibility topic and learn about new features by using the Visual Studio 2010 and .NET Framework 4 Walkthroughs. "

    I recommend that you submit a feedback to the product team at the connect website so that they can further investigate this issue and fix it as soon as possible. Currently you may just perform local installation of your SQL Server 2008 Express or postpone to install .NET Framework 4.0 Client Profile.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Tuesday, August 17, 2010 12:16 PM
    Moderator
  • Thanks Charles.

    I've reinstalled .NET 4.0 (using the full package of .NET Framework 4.0 - dotNetFx40_Full_x86_x64.exe) and the problem still persists.  I'll submit my feedback to the product team accordingly.

    Regards,
    Min Keng

     

    • Marked as answer by Min Keng Wednesday, August 18, 2010 1:04 AM
    • Unmarked as answer by Min Keng Monday, August 30, 2010 1:08 AM
    Wednesday, August 18, 2010 1:04 AM
  • I read up some issues on System.Security.SecurityException and come across some article on legacyCASPolicy and loadFromRemoteSources elements.
    I did a search of the config files on the SQL setup files and found these files:

    setup.exe.config
    setup100.exe.config
    fixsqlregistrykey_ia64.exe.config
    fixsqlregistrykey_x64.exe.config
    fixsqlregistrykey_x86.exe.config
    landingpage.exe.config

    I updated the <runtime> element to disable legacyCASPolicy and added loadFromRemoteSources element to these files.
    Here are the changes:

    ...
      <runtime>
        <legacyCasPolicy enabled="false" />
        <loadFromRemoteSources enabled="true"/>
      </runtime>
    ...

    I tested the setup.exe and things seemed to run smoothly now.
    Are these changes correct?
    Or I might be breaking something else?

    Please advise.
    Thanks.

    • Marked as answer by Min Keng Monday, August 30, 2010 1:07 AM
    Wednesday, August 25, 2010 8:13 AM
  • Min,

    CAS may be the problem since it is a significant security change in .NET 4.0, however I think that these changes should not cause users to manually modify each config files for a setup. You may submit a feedback to report this issue to our product team and hope this issue will be fixed in future. Thanks.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    • Marked as answer by Min Keng Monday, August 30, 2010 1:07 AM
    Friday, August 27, 2010 9:35 AM
    Moderator
  • Yes, I've sent the feedback to the product team.

    Thanks,

    Min Keng

    • Marked as answer by Min Keng Monday, August 30, 2010 1:07 AM
    Monday, August 30, 2010 1:07 AM
  • We met same issue, Is there any updates for this issue?

    Thanks

    Lynn

     

    Monday, November 29, 2010 8:54 AM
  • Having same issue with SQL Server 2008 with slipstream SP2 and CUM 1. Copying the installation media to each PC seems to be the only viable work around.
    Friday, May 27, 2011 4:46 PM
  • You can work around this in several ways:
    1. Use the v4.0 caspol.exe (%windir%\microsoft.net\framework\v4.0.30319\caspol.exe and %windir%\microsoft.net\framework64\v4.0.30319 on a 64 bit machine) to fully trust the share: http://blogs.msdn.com/b/shawnfa/archive/2004/12/30/344554.aspx

    2. Remove the v4 supported attribute from config to force things back to v3.5 SP1

    3. Run from the local machine

    Regards,

    Min Keng

    • Proposed as answer by Jason Fertig Wednesday, February 22, 2012 6:32 PM
    Wednesday, June 8, 2011 7:27 AM
  • Min, thanks for the fix.  This issue has been dogging me for a while now.  I've tried the caspol command with mixed results.  It did not work for me this time, so i search the issue again and found your solution.  It worked for me.  It worked on the RTM, SP, CU, and slipstream media. 

    I have a lot of versions.  Also, a slipstream has a lot of config files.  i ended up writing a powershell function to update the all matching config files in a given folder.  Might make it easier to apply the fix consistently. 

    # File: Fix-SqlSetupConfigFiles.ps1
    # Function Fix-SqlSetupConfigFiles
    # Requires -version 2
    # RStone - 3/8/2012
    # 
    # Update *.config files in a specified directory when required.  If the runtime 
    # node matches the pre Net 4 version, it is updated to allow remote execution.  
    #
    # folder - the folder name containing the media (e.g., RTM, SP, CU, slipstream)
    #
    # Examples: 
    #
    # Sample (dot source into the current scope): 
    #     . "F:\SqlServerInstalls\_psutil\Fix-SqlSetupConfigFiles.ps1"
    #     Fix-SqlSetupConfigFiles "F:\SqlServerMedia\10_50_2500_2008R2_SP1"
    Set-StrictMode -Version Latest
    $script:ErrorActionPreference = "Stop"
    $private:currentPath = Split-Path -Path $MyInvocation.MyCommand.Definition -parent 
    $private:parentPath = Split-Path -Path $private:currentPath -parent 
    # Load dependancies, if any
    # Define function
    function Fix-SqlSetupConfigFiles(
        [string]$mediaPath
        ) 
    {
    	# The before and after versions of the "runtime" node when using OuterXml and 
    	# preserving whitespace.  Assumes that the format and whitespace is the same in 
    	# all files to change.
    $runtime_outer_xml_old = @"
    <runtime>
        <legacyCasPolicy enabled="true" />
      </runtime>
    "@
    $runtime_outer_xml_new = @"
    <runtime>
        <legacyCasPolicy enabled="false" />
        <loadFromRemoteSources enabled="true" />
      </runtime>
    "@
    	# OuterXml is read-only.  Here is the new InnerXml value - InnerXml is read-write.
    $runtime_inner_xml_new = @"
        <legacyCasPolicy enabled="false" />
        <loadFromRemoteSources enabled="true" />
      
    "@
    	# Create an xml object and set PreserveWhitespace to true prior to any loading. 
    	$xml = new-object xml
    	$xml.psbase.PreserveWhitespace = $true
    	# A list of files to check
    	Write-Host "getting a list of config files..."
    	$configFiles = dir -Recurse -Filter "*.config" -Path "$mediaPath" | %{$_.FullName}
    	# Check each file, updating the xml if required.  
    	
    	foreach ($file in $configFiles) {
    		Write-Host "$file" -NoNewline
    		# Try to load the file as xml.
    		try {
    			$xml.Load("$file")
    	 		Write-Host " - loaded" -NoNewline
    		} catch {
    	 		Write-Host " - Error Loading XML file"
    			Write-Host $_.Exception.Message.ToString()
    			continue
    		}
    		# Check the runtime node and update it if required.  If the node is 
    		# not present or does not match an expected form, nothing is done.
    		try {
    			$runtime = $xml.SelectSingleNode('/configuration/runtime')
    			if ($runtime -eq $null) {
    				Write-Host " - `"runtime`" NODE NOT FOUND"
    			} elseif ($runtime.OuterXml -eq $runtime_outer_xml_old) {
    				Write-Host " - needs updated" -NoNewline
    				$runtime.InnerXml = $runtime_inner_xml_new
    				$xml.Save("$file")
    				Write-Host " - file updated"
    			} elseif ($runtime.OuterXml -eq $runtime_outer_xml_new) {
    				Write-Host " - already updated"
    			} else { 
    				Write-Host " - NOT RECOGNIZED"
    			}
    		} catch {
    	 		Write-Host " - Error"
    			Write-Host $_.Exception.Message.ToString()
    		}
    		
    	}
    }
    #Fix-SqlSetupConfigFiles "F:\SqlServerMediaRaw\CopyTest" #testing

    Thanks, Randy


    Randy in Marin

    Friday, March 9, 2012 6:34 PM
  • Looks like a bug in powershell code display.  The escaped quote `" should not be treated a string delimiter.


    Randy in Marin

    Friday, March 9, 2012 6:41 PM
  • Thanks everyone in this post for the info.  I met with the same problem on a machine with .NET 4.0 installed ,  according to this post , I succeeded install sql 2008 after rename "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" to something else and changed it back after install finished.

    Tuesday, May 22, 2012 5:15 PM