“Access to the path … is denied” error when trying to get DLLs or netmodules in Visual Studio in a D365F&O development VM onebox

If you use ISVs that ship netmodules or DLLs, a developer trying to “get latest” in Visual Studio might get errors, telling them that they cannot overwrite existing DLLs. The error might read something like “Access to the path … is denied.” There are a few ways to solve this problem.

If you use ISVs that ship netmodules or DLLs, they can be a little tricky to merge, build, and distribute to multiple developers. Besides making sure that you “include” all the right files when you first check in their models, if you later check in changes when the ISVs ship them, this can cause problems for other developers.

A developer trying to “get latest” in Visual Studio might get errors, telling them that they cannot overwrite existing DLLs. The error might read something like “Access to the path … is denied.” Here’s an example I get when I try to get a DLL from the ISV Avalara:

Example error: “Access to the path ‘K:\AosService\PackagesLocalDirectory\AVAModel\bin\Dynamics.AX.AVAModel.dll’ is denied.”

There are a few ways to solve this problem:

(1) Stop Services

I keep a batch file that I can “run as administrator” to do this, or you can manually do it in Sevices. (A second batch file changing “NET STOP to “NET START” can restart them.)

NET STOP "MR2012ProcessService"
NET STOP "DynamicsAxBatch"
NET STOP "Microsoft.Dynamics.AX.Framework.Tools.DMF.SSISHelperService.exe"
NET STOP "W3SVC"
PAUSE

(2) Stop IIS Express

If stopping services isn’t good enough, you might need to stop IIS Express, which Visual Studio automatically launches every time you start it. It isn’t a service, though; you need to close it from a little tray icon. Right-click it and choose “Exit.” You’ll probably need to restart Visual Studio before you can debug again.

Right-click the IIS Express icon and choose “Exit.”

(3) Advanced “get”

Do an “advanced get” and be sure to click the checkbox to overwrite existing files.

Right-click the branch; instead of Get Latest Version, select Advanced > Get Specific Version.
Check the box for “Overwrite writeable files that are not checked out” before clicking “Get.”

(4) Delete & Get

A final desperate move, after stopping the services and IIS Express, is to outright delete the files (via Windows Explorer) that it refuses to overwrite. Then it might let you get them since it doesn’t need to overwrite them.


Did these tips help? Do you know an easier way, or something I missed? Let me know in the comments!

2 thoughts on ““Access to the path … is denied” error when trying to get DLLs or netmodules in Visual Studio in a D365F&O development VM onebox”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s