Fix Namespace is already defined errors - gHacks Tech News

Fix Namespace is already defined errors

The error message Namespace is already defined may be displayed when you open the Group Policy editor on Windows 10, or try to edit an affected policy.

As an example, the following error message was displayed twice when I opened the Group Policy Editor on a Windows 10 machine:

Namespace 'Microsoft.Policies.Sensors.WindowsLocationProvider' is already defined as the target namespace for another file in the store.

File C:\WINDOWS\PolicyDefinitions\Microsoft-Windows-Geolocation-WLPAdm.admx, line 5, column 110

The issue is caused by a name change of a policy in Windows 10 Build 1511. The policy's original name was Microsoft-Windows-Geolocation-WLPAdm.admx in Windows 10 RTM, but has been renamed to LocationProviderADM.admx in Windows 10 Build 1511.

The Group Policy editor detects the namespace conflict, and informs you about it with an error message.

Namespace is already defined

namespace is already defined error

The namespace is already defined error may be thrown on home computer systems that were upgraded from Windows 10 RTM to a newer version such as Windows 10 version 1511.

It may also be an issue on business or enterprise systems if a central store for Group Policy Administrative Template files is used if the conflicting policy was copied to the store.

Fixing the issue

The error message is informational, which means that it can be ignored without ill-effect. The removal depends on whether a central store is being used or not.

Local system, no central store

namespace error

The solution in this case is to delete the old policy template file on the computer. The error message highlights the path it is stored under: C:\Windows\PolicyDefinitions\

While you can access the folder without experiencing issues, you will notice that you cannot remove the files it contains.

ADMX and ADML files are system protected which means that you cannot rename, move or delete them by default.

You need to add NTFS permissions to the files, and this is done on the command line.

Step 1: Open an elevated command prompt

cmd elevated

Tap on the Windows-key, type cmd.exe, hold down Shift and CTRL on the keyboard, and hit enter. Alternatively, right-click on the Command Prompt result and select "run as administrator" from the context menu.

This opens an elevated command prompt which is needed to run the commands.

Step 2: Run commands to add the required permissions

takeown commands

The two commands that you need to execute are:

takeown /F " C:\Windows\PolicyDefinitions\Microsoft-Windows-Geolocation-WLPAdm.admx" /A

takeown /F " C:\Windows\PolicyDefinitions\en-US\Microsoft-Windows-Geolocation-WLPAdm.adml" /A

Note: You may need to replace the \en-US\ part of the second command with another locale. Check the folder C:\Windows\PolicyDefinitions and there the locale subfolder to find out if that is the case.

Windows displays a success message after each command indicating that the file is now "owned by the administrators group.

Step 3: Grant administrators full access

full control

Administrators need full access to the files, and that is handled in this step.

  1. Open the folder C:\Windows\PolicyDefinitions in File Explorer, and right-click on Microsoft-Windows-Geolocation-WLPAdm.admx.
  2. Select properties from the context menu.
  3. Switch to the Security tab.
  4. Select the edit button when the page opens.
  5. Select the Administrators group under "group or user names".
  6. Check the "full control" box under allow.
  7. Accept the Windows Security message that is displayed.
  8. Click ok.

Repeat the steps for C:\Windows\PolicyDefinitions\en-US\Microsoft-Windows-Geolocation-WLPAdm.adml. Again, change the en-US locale to the one used on the device if necessary.

Step 4: Rename or delete the file

namespace error

Use File Explorer to open C:\Windows\PolicyDefinitions and locate the Microsoft-Windows-Geolocation-WLPAdm.admx file in the listing.

You may want to rename the policy template for safekeeping. This is done by right-clicking on it and selecting rename from the context menu.

Replace the file extension from .admx to .old, so that the new filename should read Microsoft-Windows-Geolocation-WLPAdm.old.

Windows may display a prompt on execution that warns you that the file may become unusable if you change its extension.

rename

Select yes since this is intentional. Windows displays a second prompt afterwards stating that you need administrative permissions to rename the file.

file access denied

Select continue to provide administrative permissions for the file change, and repeat the operation for the second file.

Alternatively, delete the files outright instead of renaming them.

Central Store solution

Do the following to resolve the issue if central store is used.

  1. Delete the files LocationProviderADM.admx and LocationProviderADM.adml from the central store.
  2. Rename Microsoft-Windows-Geolocation-WLPAdm.admx as LocationProviderADM.admx.
  3. Rename Microsoft-Windows-Geolocation-WLPAdm.adml as LocationProviderADM.adml.

Closing Words

The Group Policy should open without errors after making the changes. Please note that the method should work for other namespace conflicts as well. If Microsoft decides to modify names without removing policies for instance, it will resolve those issues as well.

Summary
Fix Namespace is already defined errors
Article Name
Fix Namespace is already defined errors
Description
Find out how to resolve namespace is already defined errors when opening or using the Group Policy editor on Windows 10 devices.
Author
Publisher
Ghacks Technology News
Logo




  • We need your help

    Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

    We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats (video ads) or subscription fees.

    If you like our content, and would like to help, please consider making a contribution:

    Comments

    1. LogicDaemon said on June 20, 2016 at 1:27 pm
      Reply

      TYVM, I stumbled upon this warning once in a while, but since it’s warning I didn’t care enough to investigate.
      Now I know Microsoft sometimes renames files and doesn’t care enough to remove old ones.

    2. Pete said on June 20, 2016 at 3:30 pm
      Reply

      Thats a lot of work for solving the issue…………

    3. CHEF-KOCH said on June 20, 2016 at 4:36 pm
      Reply

      I heard Group Policy corruption are coming from several KB’s I’m unsure because I not use Home/Pro/Preview Windows but this seems never ending problem. Even on a fresh installed and patched system. ^^

      Nice guide anyway. Sadly MS somehow can’t fix this once and for all. I only can imagine that such stuff is annoying.

    4. Anonymous said on June 20, 2016 at 7:03 pm
      Reply

      Thank you, this has bothered me for a while.

    5. Anonymous said on June 20, 2016 at 10:50 pm
      Reply

      Yeah – thanks. I figured it wasn’t fatal. But still an annoyance.

    6. Kuljeet said on October 10, 2016 at 7:42 pm
      Reply

      Can’t thank you enough buddy,that was so annoying to see it everytime really helped.

    7. Austin said on October 28, 2016 at 12:46 am
      Reply

      Thanks Martin–I’m hugely impressed at the totally comprehensive solution you’ve given–a lot of work for a silly Microsoft problem. Needless to say I’m now following you on Twitter.
      Austin

    8. FranticInFresno said on November 25, 2016 at 5:16 pm
      Reply

      Worked like a charm.
      Nice work.
      Thank you!

    Leave a Reply