Error compiling the solution for windows(windows 11, vs 2022).
I am trying to compile visual studio solution for windows (w11), do the following steps:
install Visual Studio 2022 with all the necessary libraries and packages (c++ libraries, MFC and ATL).
Install Rust for x86_64 and ARM64 targets if SSO is enabled in the build.
When compiling the solution, it doesn't show errors, but when compiling the project (debug or realise, x64) the command prompt opens for a second and closes, showing the following errors:
- Exception thrown at 0x00007FFC75B1FE7C (KernelBase.dll) in zerotier-one_x64.exe: 0x00000005: Access is denied.
- 'zerotier-one_x64.exe' (Win32): 'C:\Windows\System32\kernel.appcore.dll' loaded.
- Thread 0x687c terminated with code 1 (0x1).
- Thread 0x2fc4 terminated with code 1 (0x1).
- Thread 0x7060 terminated with code 1 (0x1).
- The program '[26800] zerotier-one_x64.exe' terminated with code 1 (0x1).
If you're attempting to run ZeroTier from within Visual Studio, you need to start Visual Studio as an administrator as ZeroTier requires admin privileges to operate.
Also sounds like the debugger isn't set to stop on 0x00000005. You can configure it like this
I had the same error running visual studio as administrator. Configuring the exception debugger, it gives me the error in the following function :
--------ServiceBase.cpp-------- Line: 49.---------------------- // // FUNCTION: CServiceBase::Run(CServiceBase &) // // PURPOSE: Register the executable for a service with the Service Control // Manager (SCM). After you call Run(ServiceBase), the SCM issues a Start // command, which results in a call to the OnStart method in the service. // This method blocks until the service has stopped. // // PARAMETERS: // * service - the reference to a CServiceBase object. It will become the // singleton service instance of this service application. // // RETURN VALUE: If the function succeeds, the return value is TRUE. If the // function fails, the return value is FALSE. To get extended error // information, call GetLastError. // BOOL CServiceBase::Run(CServiceBase &service) { s_service = &service;
SERVICE_TABLE_ENTRYA serviceTable[] =
{
{ service.m_name, ServiceMain },
{ NULL, NULL }
};
// Connects the main thread of a service process to the service control
// manager, which causes the thread to be the service control dispatcher
// thread for the calling process. This call returns when the service has
// stopped. The process should simply terminate when the call returns.
return StartServiceCtrlDispatcher(serviceTable);
}
Ahh you may need to alter the command arguments in the project to add -C. The default mode of operation on Windows is to be run as a service which has a different entrypoint. -C allows you to run it from the command line directly.
I'm having the same issue; I saw this issue was still open (after 17 months). I've searched the web, SO, ZeroTier forums, etc...this is the only mention of this issue. A fresh run with a newly downloaded source yields the same result.
Running VS 2022 as ADMIN, Win 11, Windows SDK 10.0.19041.0
Exception thrown at 0x00007FF9AC78FABC (KernelBase.dll) in zerotier-one_x64.exe: 0x00000005: Access is denied. The thread 18664 has exited with code 0 (0x0). The thread 33780 has exited with code 1 (0x1). The thread 16044 has exited with code 1 (0x1). The thread 34500 has exited with code 1 (0x1). The program '[10828] zerotier-one_x64.exe' has exited with code 1 (0x1).
Any advice?
Per the guidance above, make sure to add -C instead of -c in Command Argument