I am using Visual Studio(C++) 2010 to build a DLL project. The generated DLL is a normal DLL and I do not need to register it before using it.
However, when building the DLL project, I will always get the following error message
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5): warning MSB3075: The command "regsvr32 /s "E:\Projects\MyDLL\Release\MyDLL.dll"" exited with code 5. Please verify that you have sufficient rights to run this command.
The previous error was converted to a warning because the task was called with ContinueOnError=true.
Build continuing because "ContinueOnError" on the task "Exec" is set to "true".
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(756,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
Build FAILED.
The problem is strange in that:
- I do not have a post-build command ask Visual Studio to register DLL.
- I am the Administrator so should have enough permission even to register the DLL.
Please help. Thanks

DllRegisterServer()was found in your executable, and calling that caused an "Access Denied" error. If the DLL didn't have aDllRegisterServer, it couldn't have been called and couldn't have returned error code 5. Still, I'm always surprised by Visual Studio wanting to register DLL's. That really is the task of the installer, not the compiler. - MSalters