MscrmTools / MscrmTools.SiteMapEditor

Manage the SiteMap with no XML edition
GNU General Public License v3.0
4 stars 6 forks source link

Error occurred in CrmServiceClientTokenCache.CrmServiceClientTokenCache(). Exception Details : System.UnauthorizedAccessException: Access to the path #18

Closed mcross9095 closed 5 years ago

mcross9095 commented 5 years ago

Using XrmToolbox v1.2018.7.28 with Site Map Editor v1.2018.7.11.

Using a connection string to connect to a D365 online v8.2 instance in the Government Cloud.

This string use to work, but since upgrading XrmToolbox, getting the error log below.

Another person is having the same issue. I've tried different paths on my computer, but getting the same error for every path.

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 10/18/2018 10:05:23 AM Error occurred in CrmServiceClientTokenCache.CrmServiceClientTokenCache(). Exception Details : System.UnauthorizedAccessException: Access to the path 'C:\Users\mcross\Documents' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at Microsoft.Xrm.Tooling.Connector.CrmServiceClientTokenCache..ctor(String cacheFilePath) Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 10/18/2018 10:05:49 AM Error occurred in CrmServiceClientTokenCache.AfterAccessNotification(). Exception Details : System.UnauthorizedAccessException: Access to the path 'C:\Users\mcross\Documents' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) at Microsoft.Xrm.Tooling.Connector.CrmServiceClientTokenCache.AfterAccessNotification(TokenCacheNotificationArgs args) Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 10/18/2018 10:05:51 AM No Organizations Found, Searched online. Region Setting = NorthAmerica2 Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 10/18/2018 10:05:51 AM Unable to Login to Dynamics CRM

MscrmTools commented 5 years ago

It does not seem to be an error from XrmToolBox but from CRM SDK. Can you share your connection string (replace sensitive content)?

mcross9095 commented 5 years ago

It used to work. It looked like after we upgraded XrmToolbox it stopped working. I guess it's possible that some update was made to D365. This is the connection string with sensitive content replaced by the angle brackets <>:

AuthType=OAuth;Url=;AppId=;RedirectUri=;TokenCacheStorePath= C:\Users\mcross\Documents;LoginPrompt=Auto;RequireNewInstance=True;RequireNewInstance=True;

mcross9095 commented 5 years ago

The RequireNewInstance parameter was in there twice. Below is the correct URL.

AuthType=OAuth;Url=;AppId=;RedirectUri=;TokenCacheStorePath= C:\Users\mcross\Documents;LoginPrompt=Auto;RequireNewInstance=True;

MscrmTools commented 5 years ago

AFAIK, TokenCacheStorePath should be a file and not a folder. So, of course, if you provide a folder, especially a system one, it cannot be used to store tokens. Can you try to replace with a filename, whatever it is like C:\Users\mcross\Documents\token.bin

MscrmTools commented 5 years ago

I'm closing the issue since it is not related to SiteMapEditor