none
Strange Error when building after cleaning the registry RRS feed

  • Question

  • Hi All,

    Recently I cleaned my registry using some tool after reading some blog content about speeding up the system. After cleaning the registry I'm getting this strange error each time i build my project, I tried restoring the registry but it also fails.

    The "ResolveAssemblyReference" task failed unexpectedly.
    System.Security.SecurityException: Requested registry access is not allowed.
       at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
       at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
       at Microsoft.Win32.RegistryKey.OpenSubKey(String name)
       at Microsoft.Build.Tasks.RegistryHelper.GetSubKeyNames(RegistryKey baseKey, String subkey)
       at Microsoft.Build.Tasks.AssemblyFoldersEx.FindDirectories(RegistryKey baseKey, String registryKeyRoot, String targetRuntimeVersion, String registryKeySuffix, String osVersion, String platform, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue)
       at Microsoft.Build.Tasks.AssemblyFoldersEx..ctor(String registryKeyRoot, String targetRuntimeVersion, String registryKeySuffix, String osVersion, String platform, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue)
       at Microsoft.Build.Tasks.AssemblyFoldersExResolver.Resolve(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& foundPath, Boolean& userRequestedSpecificFile)
       at Microsoft.Build.Tasks.AssemblyResolution.ResolveReference(IEnumerable`1 jaggedResolvers, AssemblyNameExtension assemblyName, String rawFileNameCandidate, Boolean isPrimaryProjectReference, Boolean wantSpecificVersion, String[] executableExtensions, String hintPath, String assemblyFolderKey, ArrayList assembliesConsideredAndRejected, String& resolvedSearchPath, Boolean& userRequestedSpecificFile)
       at Microsoft.Build.Tasks.ReferenceTable.ResolveReference(AssemblyNameExtension assemblyName, String rawFileNameCandidate, Reference reference)
       at Microsoft.Build.Tasks.ReferenceTable.ResolveAssemblyFilenames()
       at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure()
       at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure(DependentAssembly[] remappedAssembliesValue, ITaskItem[] referenceAssemblyFiles, ITaskItem[] referenceAssemblyNames, ArrayList exceptions)
       at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute(FileExists fileExists, DirectoryExists directoryExists, GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, GetLastWriteTime getLastWriteTime)
       at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute()
       at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
    The Zone of the assembly that failed was:MyComputer


    I tried some methods posted here but none of them works

    please help me
    Friday, August 22, 2008 12:49 PM

Answers

  • Rerun the .NET Framework setup and repair the framework.  It has been corrupted.

    As an aside cleaning the registry will have no impact on system speed.  This was a common, and potentially valid, myth years ago but it doesn't apply anymore.  The most impact it'll have is the amount of memory that the OS might allocate.  Even that though is pushing it as the registry is stored partially in paged pool and partially on disk.  The SysInternals site has a good, dated article on how the OS (through W2K) manages the registry. 

    The benefit of registry cleaners has been called into question as recently as a few weeks ago (can't find the link right now).  The general consensus is that they are useless and dangerous.  The only time a smaller registry is better is when enumerating keys but this doesn't happen as often as one would imagine.  Just try running a registry monitor tool to verify that.  Google for registry cleaners and you'll find a variety of links to articles about the overall usefulness of cleaners.

    Michael Taylor - 8/22/08
    http://p3net.mvps.org
    Friday, August 22, 2008 5:36 PM
    Moderator

All replies

  • Rerun the .NET Framework setup and repair the framework.  It has been corrupted.

    As an aside cleaning the registry will have no impact on system speed.  This was a common, and potentially valid, myth years ago but it doesn't apply anymore.  The most impact it'll have is the amount of memory that the OS might allocate.  Even that though is pushing it as the registry is stored partially in paged pool and partially on disk.  The SysInternals site has a good, dated article on how the OS (through W2K) manages the registry. 

    The benefit of registry cleaners has been called into question as recently as a few weeks ago (can't find the link right now).  The general consensus is that they are useless and dangerous.  The only time a smaller registry is better is when enumerating keys but this doesn't happen as often as one would imagine.  Just try running a registry monitor tool to verify that.  Google for registry cleaners and you'll find a variety of links to articles about the overall usefulness of cleaners.

    Michael Taylor - 8/22/08
    http://p3net.mvps.org
    Friday, August 22, 2008 5:36 PM
    Moderator
  • Thank you Taylor

    Thanks for the explanation on the registry, I 'll never try to do some thing stupid as that any more.

    I'll try this solution.


    Saturday, August 23, 2008 2:40 PM
  • I tried reinstalling the framework but it doesn't succeed due to some dependency reasons.
    Then I tries resetting the permissions for registry for current users with the process described below. And at last i got the framework working. Please follow this procedure for Resetting the registry permissions.

    Actually i thought of this as once i had to do this for Vista Home editions after installing the Service Pack 1 for Vista. This helps a lot but don't know how often can we do this or the effect of it registry.






    Monday, August 25, 2008 8:45 AM