Visual studio: build tool : build actions doesn't have permission to register the LogEvent dll into GAC

Amit Yadav 20 Reputation points
2025-03-25T04:32:26.86+00:00

C:\program files\microsoft visual studio\2022\enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5634,5): error MSB3216: Cannot register assembly "C:\JCI_27March\UnifiedClients\NextGen\Bin\SoftwareHouse.CrossFire.Server.LogEvents.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\CLSID{E08E6F37-88A6-4FA2-B827-314E4748DCE1}' is denied. [C:\JCI_27March\UnifiedClients\NextGen\Platform\Server\LogEvents\LogEvents.csproj]

Developer technologies | Visual Studio | Debugging
{count} votes

Answer accepted by question author
  1. RLWA32 51,536 Reputation points
    2025-03-31T12:05:57.01+00:00

    For example, I can build an AnyCPU assembly that exposes a COM object, and register it for 32-bit use using RegAsm and also register it in the GAC.

    Since VS2022 is a 64-bit application I leave the Register for Com Interop box UNCHECKED in the project options.

    ComRegOption

    Then I add the following two post-build events. The first registers for 32-bit COM and will write to HKCR\WOW6432Node\CLSID -

    Register32bit

    The second uses the 32-bit gacutil.exe to register in the GAC -

    PostBuild

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,691 Reputation points Microsoft External Staff
    2025-03-25T10:33:27.6166667+00:00

    Hi @Amit Yadav ,

    Welcome to Microsoft Q&A forum.

    Did you try to check the permission of the registry key that mentioned in the error message?

    Search Registry editor in Windows Search box and open it => follow the message to expand the folder(hkey classes root\clsid\vedbe6f37-88a6-4fa2-8827-314e4748dce1) => if you can find it, right-click it => Permissions => select the account and check the permissions.

    If the permissions were not assigned correctly, try to click "Advanced" => select the corresponding account => click Edit => assign the permissions.

    Besides, is there any permission limitation on your machine, like antivirus, security management software, group policy, custom rules or limitations for multiple accounts…?

    Also, when did this issue appear? May I know the steps that you were performing? Is this a third-party dll file? If so, are there any corresponding guidance or documents that you followed to install/register/use it?

    Best regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.