web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Getting error while database 'AxDB' full sync in the visual studio 2022

(0) ShareShare
ReportReport
Posted on by 179

Hey Expert,

I recently imported the Production database into the Cloud-hosted DevBox. However, when attempting to perform a full database sync, I encountered the following error:

 

(Inner Exception #0)

System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See Microsoft documentation for more information.

 

If anyone has faced this issue before or has any suggestions, please share your insights.


Screenshot:





Regards,
Amir. 
I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,434 User Group Leader on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    Hi,
    your error message text shows that it is a .Net error where the current framework cannot download the assembly that it want to and your error text also suggest you to enable LoadFromRemoteResource Switch. 
     
     
  • Syed Amir Ali Profile Picture
    179 on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    Hey Sohaib Cheema,

    Thank you for your response. I added the script to the machine.config file as suggested and restarted the VM, but there was no change — instead, Visual Studio crashed.

  • Syed Amir Ali Profile Picture
    179 on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    I have checked as well but on custom DLL found in my case as well
  • Sohaib Cheema Profile Picture
    49,434 User Group Leader on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    I checked my configuration and it works without the configuration change. I do not have following:
     
    <loadFromRemoteSources enabled="true"/>
     
    What .Net Framework version you are on ? Do you have any pending updates on the Visual studio? (Help >> Check for Updates)
  • Syed Amir Ali Profile Picture
    179 on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    .net 4.8 framework. I am working on d365 Fo at lastest version .45
  • Martin Dráb Profile Picture
    237,679 Most Valuable Professional on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    You likely need to go to properties of the given assembly file and unblock it. The question is which file it's about. The assembly binding log viewer should tell you that.
     
    Was the DB restore the only activity you did before it stopped working?
  • Syed Amir Ali Profile Picture
    179 on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    Hi Martin, 

    First, I deployed a cloud-hosted development environment via LCS using the demo database, and everything was working fine. Later, I restored the production database (bacpac) file, added the custom model, and performed a full build, which completed successfully without any errors. However, when I ran the full database synchronization, it failed after a few seconds with the error mentioned in the statement.

     
  • Verified answer
    Martin Dráb Profile Picture
    237,679 Most Valuable Professional on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    Isn't the custom model to blame? Try removing it or unblocking all files there.
  • Syed Amir Ali Profile Picture
    179 on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    Thanks, Martin. Let me try removing the custom models first. I’m saying this because, by “unblocking,” I assume it refers to a custom DLL that might be in a locked state. However, I already had a custom model which contains custom .dll file, which I removed and then tried running a full sync again, but it still didn’t succeed. 
  • Syed Amir Ali Profile Picture
    179 on at
    Getting error while database 'AxDB' full sync in the visual studio 2022
    Hi @Martin Dráb,

    Thank you so much for guiding me in the right direction. Yes, the issue was with the custom models. I removed all the custom models from the environment and then ran the full database sync, and it worked perfectly.

    Regards,
    Amir.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans