reebo
reebo

Reputation: 123

Enable/install .Net Framework 3.5 in Windows Sandbox

I am trying to use Windows Sandbox to do quick tests of new releases of an application I support for basic functionality (login, etc.). I was able to set up a .wsb config file and have it run a powershell script upon logon to install the application and any system requirements.... The issue I am having is that the application requires .Net Framework 3.5 and .Net Framework 4.8 in order to function correctly. I added the following line to the login powershell script (script is run in elevated powershell window as administrator) in my .wsb file where it runs the following DISM command:

DISM /online /enable-feature /featurename:NetFX3 /All /Source:C:\users\wdagutilityaccount\desktop\WindowsSandboxScripts\sources\sxs /LimitAccess

When the script hits that line and "Error: 87" appears. See below

enter image description here

Has anyone tried running a .Net application in Windows Sandbox? If you were able to install .Net 3.5 (and 4.8) please let me know what steps I need to take to get .Net set up in Windows Sandbox. I found this post that references some problematic Windows updates but my host Windows 10 machine has neither installed.

TIA, Chris

Upvotes: 3

Views: 3012

Answers (1)

rubStackOverflow
rubStackOverflow

Reputation: 6163

I was able to to enable .NET Framework 3.5 but on sandbox 24H2 (Win11):

Open PoweShell prompt

  1. Modify Windows Update Settings: Open PowerShell with administrative privileges and run the following command to ensure Windows can download the necessary components:

    Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value 0
    
  2. Restart the Windows Update Service: Restart the service to apply the changes by executing:

    Restart-Service wuauserv
    
  3. Repair the System Image: (This step may take some time)

    dism /online /Cleanup-Image /RestoreHealth
    
  4. Download and Install the Framework (Additional Notes Bellow) :

    • Download the NET_Framework_3.5_Windows_10.zip package.
    • Extract the contents of the ZIP file to a convenient location.
    • Run the installer inside the extracted folder and wait for the process to complete.

Additional Notes

  • Download NET_Framework_3.5_Windows_10.zip from this github: https://github.com/tutorialnacional/dotnetsandbox

Screen Shots:

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: 0

Related Questions