Linux HowTo: How to uninstall .Net 4.0 in safe mode?

Original Source Link

After installing .NET 4.0 started receiving BSODs right before login (Windows XP SP3). Last known good configuration doesn’t work, but safe mode works. Trying to uninstall the .NET from Add/Remove Programs says that windows installer can’t run in safe mode. Any workarounds?

I’ve had some success with the removal tool that purports to remove all of the .NET files externally. I don’t know if it works in safe mode, though, so YMMV.

Maybe Silent install, repair and uninstall command lines for the .NET Framework 4 can help.

To run an MSI Installer in safe mode, you’ll first have to enable the msi service:

To start Windows Installer in Safe Mode:

  1. Restart your computer and press F8 before the Boot Menu or splash screen.

  2. Open a CMD.EXE window.

  3. Type the following commands and press Enter:

    REG ADD
    “HKLMSYSTEMCurrentControlSetControlSafeBootMinimalMSIServer” /VE
    /T REG_SZ /F /D “Service”

    net start msiserver

(Taken from: Windows: Enable MSI Service in Safe Mode)

However, from reading some of the comments in the post, it seems that if you’re running XP Home, the REG command may not be available and you’ll have to manually open the Registry Editor (regedit) and edit the required keys:

Start > Run > ‘regedit’

Browse to HKLMSYSTEMCurrentControlSetControlSafeBoot

Create a new folder for ‘MSIServer’ by right-clicking on either
‘Minimal’ or ‘Network’ and choosing ‘New’ > ‘Key’. Enter ‘MSIServer’
(CaSe SeNsItIvE).

Minimal is safe mode WITHOUT network support.

Network is safe mode WITH network support.

You’ll probably want to do this for both.

Browse to the new key you just created. On the right pane, right-click
on the white space and choose ‘New’ > ‘String Value’ and enter
‘Service’ (CaSe SeNsItIvE).

You’re done. In safe mode, Start > Run > ‘services.msc’, find ‘Windows
Installer’ and start it. If it starts, you did everything right. If it
doesn’t work check for case sensitivity and that you’re in the right
safe mode (minimal or network).

(Source)

Tagged : / /

Making Game: How to uninstall .Net 4.0 in safe mode?

Original Source Link

After installing .NET 4.0 started receiving BSODs right before login (Windows XP SP3). Last known good configuration doesn’t work, but safe mode works. Trying to uninstall the .NET from Add/Remove Programs says that windows installer can’t run in safe mode. Any workarounds?

I’ve had some success with the removal tool that purports to remove all of the .NET files externally. I don’t know if it works in safe mode, though, so YMMV.

Maybe Silent install, repair and uninstall command lines for the .NET Framework 4 can help.

To run an MSI Installer in safe mode, you’ll first have to enable the msi service:

To start Windows Installer in Safe Mode:

  1. Restart your computer and press F8 before the Boot Menu or splash screen.

  2. Open a CMD.EXE window.

  3. Type the following commands and press Enter:

    REG ADD
    “HKLMSYSTEMCurrentControlSetControlSafeBootMinimalMSIServer” /VE
    /T REG_SZ /F /D “Service”

    net start msiserver

(Taken from: Windows: Enable MSI Service in Safe Mode)

However, from reading some of the comments in the post, it seems that if you’re running XP Home, the REG command may not be available and you’ll have to manually open the Registry Editor (regedit) and edit the required keys:

Start > Run > ‘regedit’

Browse to HKLMSYSTEMCurrentControlSetControlSafeBoot

Create a new folder for ‘MSIServer’ by right-clicking on either
‘Minimal’ or ‘Network’ and choosing ‘New’ > ‘Key’. Enter ‘MSIServer’
(CaSe SeNsItIvE).

Minimal is safe mode WITHOUT network support.

Network is safe mode WITH network support.

You’ll probably want to do this for both.

Browse to the new key you just created. On the right pane, right-click
on the white space and choose ‘New’ > ‘String Value’ and enter
‘Service’ (CaSe SeNsItIvE).

You’re done. In safe mode, Start > Run > ‘services.msc’, find ‘Windows
Installer’ and start it. If it starts, you did everything right. If it
doesn’t work check for case sensitivity and that you’re in the right
safe mode (minimal or network).

(Source)

Tagged : / /

Code Bug Fix: Is it normal for Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole to return an empty set when there are user roles?

Original Source Link

I am trying to return a list of ApplicationUser which belongs to different IdentityRole and those that also do not belong to any role.

So when I did my testing I noticed that the following statement gave me all the users in the system.

UserManager.Users.Include(x => x.Roles).Where(u => u.Roles.Count == 0);

To me the statement should mean that if there are no roles to the user, it should return it as part of the set but apparently on debugging, all the users return a count of 0.

If I were to use the appropriate RoleManager for if a user belongs to the role or not, I get the correct answer:

UserManager.IsInRole(applicationUser.Id, "Administrator");

So I am trying to figure out if it is normal for it to return an empty set.

Also within my database, the aspnetuserroles table the foreign key to the identityusers seems to be pointing to the wrong column or the code is updating to the wrong column.
The table looks like this:

CREATE TABLE `aspnetuserroles` (
  `UserId` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
  `RoleId` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
  `IdentityUser_Id` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`UserId`,`RoleId`),
  KEY `IdentityRole_Users` (`RoleId`),
  KEY `IdentityUser_Id` (`IdentityUser_Id`),
  CONSTRAINT `IdentityRole_Users` FOREIGN KEY (`RoleId`) REFERENCES `aspnetroles` (`Id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  CONSTRAINT `IdentityUser_Roles` FOREIGN KEY (`IdentityUser_Id`) REFERENCES `identityusers` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

The UserId column has all the correct User Ids but is not referenced.
The IdentityUser_Id column is all null and is referenced for some reason.

Any advice is greatly appreciated.

I did a little testing and found that when using

UserManager.Users.Include(x => x.Roles).Where(u => u.Roles.Count == 0);

I was also getting 0 results even though I know for sure it shouldn’t have been. So, I decided to look at what was going on in the debugger. It was actually erroring, but I didn’t know it without looking at the debugger. I’m not entirely sure what you’re trying to get, but by throwing a ToList() on the end like so

UserManager.Users.Include(x => x.Roles).Where(u => u.Roles.Count == 0).ToList();

I started getting expected results. Hopefully it works for you, too! Also, using the following netted me all the same results. Good luck!

UserManager.Users.Where(x => x.Roles.Count == 0).ToList();

Tagged : / / / /

Linux HowTo: Silent install of .NET 4.0 on Windows Embedded Standard 7

Original Source Link

I want to perform a silent install of the .NET 4.0 framework on a Windows Embedded Standard 7 installation. This means I want to use the Image Configuration Editor (ICE) to perform this. I already downladed the templates to solve all the dependencies. I think the .NET 4.0 installation is failing because of the lack of Administrator rights. I added three commands to Deployment_x86 in my answer file:

  • net user administrator /active:yes
  • C:Setup_FilesdotNetFx40_Full_x86_x64.exe
  • net user administrator /active:no

Everything on pass 6: Audit User. For now it does not work. What would be the needed steps to achieve what I want?

Rights problems during installation can not be. Performing during the installation of the operating system occurs with the rights SYSTEM.

Accordingly, the command net user administrator /active ... not need.

You will need the templates that can be taken here:

Application templates on Windows Embedded Standard 7

I think it’s not quite the distribution. Net 4, which is needed.

Try to get hold of this one:

Microsoft .NET Framework 4.0 for Windows Embedded Standard 7 (Dec 2010)

may be help …

Tagged : / / /

Making Game: Silent install of .NET 4.0 on Windows Embedded Standard 7

Original Source Link

I want to perform a silent install of the .NET 4.0 framework on a Windows Embedded Standard 7 installation. This means I want to use the Image Configuration Editor (ICE) to perform this. I already downladed the templates to solve all the dependencies. I think the .NET 4.0 installation is failing because of the lack of Administrator rights. I added three commands to Deployment_x86 in my answer file:

  • net user administrator /active:yes
  • C:Setup_FilesdotNetFx40_Full_x86_x64.exe
  • net user administrator /active:no

Everything on pass 6: Audit User. For now it does not work. What would be the needed steps to achieve what I want?

Rights problems during installation can not be. Performing during the installation of the operating system occurs with the rights SYSTEM.

Accordingly, the command net user administrator /active ... not need.

You will need the templates that can be taken here:

Application templates on Windows Embedded Standard 7

I think it’s not quite the distribution. Net 4, which is needed.

Try to get hold of this one:

Microsoft .NET Framework 4.0 for Windows Embedded Standard 7 (Dec 2010)

may be help …

Tagged : / / /

Server Bug Fix: Importing NTFSSecurity module from UNC path fails

Original Source Link

I’ve created a central repository for Powershell modules, but I’m having trouble loading one in particular. The NTFSSecurity module is failing to import with the following message.

PS Z:> Import-Module NTFSSecurity
Add-Type : Could not load file or assembly 'file://\fsPowerShellModulesNTFSSecuritySecurity2.dll' or one of its
dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At \fsPowerShellModulesNTFSSecurityNTFSSecurity.Init.ps1:141 char:1
+ Add-Type -Path $PSScriptRootSecurity2.dll
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Type], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : Could not load file or assembly 'file://\fsPowerShellModulesNTFSSecurityPrivilegeControl.dll' or one
of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At \fsPowerShellModulesNTFSSecurityNTFSSecurity.Init.ps1:142 char:1
+ Add-Type -Path $PSScriptRootPrivilegeControl.dll -ReferencedAssemblies $PSScrip ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Type], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand

Add-Type : Could not load file or assembly 'file://\fsPowerShellModulesNTFSSecurityProcessPrivileges.dll' or one
of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At \fsPowerShellModulesNTFSSecurityNTFSSecurity.Init.ps1:143 char:1
+ Add-Type -Path $PSScriptRootProcessPrivileges.dll
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Type], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand

Types added
NTFSSecurity Module loaded
Import-Module : Unable to find type [Security2.IdentityReference2]: make sure that the assembly containing this type
is loaded.
At line:1 char:1
+ Import-Module NTFSSecurity
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Security2.IdentityReference2:TypeName) [Import-Module], RuntimeExcept
   ion
    + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

I’m running Windows Managment Foundation 3.0 Beta, which includes PowerShell 3.0. I have a feeling that the new security measures introduced in .NET 4.0 are playing a part in this, but running Powershell.exe with the -version 2.0 switch doesn’t fix anything either. I have modified my powershell.exe.config files in both the system32 and SysWOW64 folders to the following.

<?xml version="1.0"?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0.30319"/>
        <supportedRuntime version="v2.0.50727"/>
    </startup>
    <runtime>
        <loadfromremotesources enabled="true"/>
    </runtime>
</configuration>

The files are not “blocked”, I’ve checked each one individually (as well as run Unblock-File on the directory). Permissions from the server end are fine, I’ve verified that I have access to everything. What have I not checked?

It might be a corrupt file/bad download.

I was receiving the same error when trying to load the module from one of my scripts. I went and re-downloaded the newer v2.3 and extracted it into my Powershell Modules folder (C:windowssystem32WindowsPowershellv1.0ModulesNTFSSecurity).

This solved my problem.

Rather than load the module directly from a share, I tend to have a function that copies it locally (this can be adjusted to look for newer versions as well). I suppose this could be written in-line, but I made it a function as part of my ‘common modules’ that I load.

Function Import-NTFSModule {
   $NTModule = 'C:WindowsSystem32WindowsPowershellv1.0ModulesNTFSSecurity'
   $NTSource = '\servername.fqdnsharenameModulesNTFSSecurity'
   If (!(Get-Module -Name NTFSSecurity)) {
      If (!(Test-Path -Path $NTModule) -and (Test-Path $NTSource)) { Copy-Item $NTSource -Destination "$NTModule" -Recurse -Force }
   }
}

By default, the .ZIP file you download is blocked from being executed. Right-click it and choose “Unblock” before you unpack it, and the files beneath will be unblocked as well.

Sorry that when I originally posted, I didn’t see that you said you had unblocked it. I only got the error (identical error code) while the files were in a blocked state.

Run the Import-Module NTFSSecurity from Windows Powershell (not the ISE)

Tagged : /