SBX - Search With Button

SBX - Forum Post Title

How delete a specific model/package?

Dynamics 365 for Finance and Operations Forum

Foxsor asked a question on 18 Jan 2017 3:14 AM
My Badges

Question Status

Verified

Hello,

In visual Studio, you can Add/Update model/package.

But no option to delete.

I don't see an official method to do the job.

I guess delete specific directory package file or delete the directory specific model file (with deleting the xml file descriptor in package Descriptor directory ) could be the solution.

Any idea?

Reply
Verified Answer

Hi Foxsor,

At this moment deleting a package/model is not supported. To have it deleted, it would be the best to deploy a new environment and don't apply the packages which are not required.

Reply
Rik Spoor responded on 18 Jan 2017 3:47 AM
My Badges
Verified Answer

I concur with Andre, there is no right way to uninstall a hotfix package exept for restoring the backup you made before installing the update. Or starting with a fresh machine and re-applying your customisations.

Reply
Foxsor responded on 18 Jan 2017 4:32 AM
My Badges

Thank's André and Rik for you reply

Reply
Basheeruddin Mohammad responded on 18 Jan 2017 4:47 AM
My Badges
Suggested Answer

We have used ModelUtil.exe to delete models in dev environment.

C:\AOSService\PackagesLocalDirectory\Bin>ModelUtil.exe

Usage: ModelUtil.exe -delete -metadatastorepath=[path to metadata store] -modelname=[name of the model to delete]

Reply
Atul Shukla responded on 9 May 2017 1:39 PM
Suggested Answer

I agree to 'Mohammad Basheeruddin's response. ModelUtil.exe can be used for the purpose of removing or deleting a model. It is command prompt utility. 

Just adding little more details here about the usage.  At command prompt: 
1. Browse to: C:\AOSService\PackagesLocalDirectory\bin folder.
2. Type in ModelUtil.exe /? to get to know about parameters.
3. I did import a custom model name was "Application suite VAR model" and I did remove it using following command:

C:\AOSService\PackagesLocalDirectory\Bin>ModelUtil.exe -delete -metadatastorepath="C:\AOSService\PackagesLocalDirectory" -modelname="Application suite VAR model"   <press Enter>
Are you sure you want to delete model Application suite VAR model? (Y/N)
y

C:\AOSService\PackagesLocalDirectory\Bin>

Reply

There are two moments when you would like to remove a model. In development stage and on a live environment. My answer was based on a live environment. Then you cannot use this ModelUtil.exe as Microsoft is only installing deployable packages on the Azure machines.

In the development environment you can delete models, but I wonder if it will really remove build features or only the development objects. Haven't tested this yet.

Reply
Atul Shukla responded on 10 May 2017 1:15 AM

Yes. Agree with you. In Production environment, LCS team does the deployments so client/partner don't get access to PROD.

I did use it on Development environment and it does delete the model and metadata information from the file system. However, if there are some DB changes (for example, addition of fields in the table or created a new table altogether) and DB synchronization is already complete, then DB changes do not go away with model delete. They persist. Now since extension model is deleted and files don't exist in the system, eventually there is no way the added fields can be deleted unless one has to do hard way (delete from table directly - not recommended).

Reply
Uzair Saleem responded on 11 Jun 2017 3:55 AM
My Badges
Suggested Answer

For model deletion use modelutil.exe delete command and delete the folder after stopping service. then build and sync.

For Package deletion on dev environment , just stop the AOS service, delete the package folder inside the PackagesLocalDirectory , then start service, build and sync.

Reply
Fahad Ahmed responded on 9 Jul 2017 12:06 AM
My Badges

Hi Guys - 

I deleted a custom package but didn't stop the service (not even even sure which service in D365 corresponds to AOS service) later when I try to run the application through VS (after building and syncing it) or access the URL, I get the following error. 

Service Unavailable


HTTP Error 503. The service is unavailable.

I checked the service Microsoft Dynamics 365 for Operations - Batch Management Service was stopped (not sure how) so I started it. Still getting the same error. 


Any suggestions? 

-Fahad

Reply
Uzair Saleem responded on 10 Jul 2017 1:37 AM
My Badges

Hi  Fahad,

Building and synching done successfully without any error?

have you check the application pool?

what you found in event viewer?

Please share some more detail

Reply

Hi Fahad,

Did you also create a new question on the forum? Please don't duplicate your posts. This is the link to the new question from Fahad: community.dynamics.com/.../243141.

Reply
Fahad Ahmed responded on 10 Jul 2017 9:40 AM
My Badges

Hi All - I posted the answer on the orignal thread. community.dynamics.com/.../243141

Reply
Bharath Govinda responded on 30 Jan 2018 2:05 AM
Suggested Answer

Assuming that the package should be deleted from UAT/LIVE

1. Delete all the components from package and create deployable package out of it from DEV using VS.

2. Create a text file call “ModuleToRemove.txt” and put it into the AOSService\Scripts folder

3. In the text file, put in the name of the module you want to remove, for example – “MyModule”

4. Zip up the package and upload into the asset library

5. Apply the package in UAT/LIVE.

Reply
Ray DAX responded on 7 Mar 2018 9:17 PM
My Badges

Hello All,

I see that you are talking about deleting a specific model/package that had been installed.  But how about deleting a hotfix that was installed.  Coz in the case of hotfix, there is not one clear model/package folder.  ALl you know from the "view installed hotfixes" screen is that the hotfix went into ApplicationSuite Package.  

Please advise if any of you found a way to do this.  And i am talking of non-PROD scenario, so I have access to ModelUtil.exe.

Thanks,

Raghu.

Reply
Bharath Govinda responded on 8 Mar 2018 7:30 AM
Suggested Answer

This looks like different question. Can you please ask it as a new one. Also, to tell answer in short you need to have changeset details, when you checked in the HOTFIX changes to VSTS. May be through that changeset you can compare the code and remove the code related to HOTFIX.

Reply
Verified Answer

Hi Foxsor,

At this moment deleting a package/model is not supported. To have it deleted, it would be the best to deploy a new environment and don't apply the packages which are not required.

Reply
Rik Spoor responded on 18 Jan 2017 3:47 AM
My Badges
Verified Answer

I concur with Andre, there is no right way to uninstall a hotfix package exept for restoring the backup you made before installing the update. Or starting with a fresh machine and re-applying your customisations.

Reply
Basheeruddin Mohammad responded on 18 Jan 2017 4:47 AM
My Badges
Suggested Answer

We have used ModelUtil.exe to delete models in dev environment.

C:\AOSService\PackagesLocalDirectory\Bin>ModelUtil.exe

Usage: ModelUtil.exe -delete -metadatastorepath=[path to metadata store] -modelname=[name of the model to delete]

Reply
Atul Shukla responded on 9 May 2017 1:39 PM
Suggested Answer

I agree to 'Mohammad Basheeruddin's response. ModelUtil.exe can be used for the purpose of removing or deleting a model. It is command prompt utility. 

Just adding little more details here about the usage.  At command prompt: 
1. Browse to: C:\AOSService\PackagesLocalDirectory\bin folder.
2. Type in ModelUtil.exe /? to get to know about parameters.
3. I did import a custom model name was "Application suite VAR model" and I did remove it using following command:

C:\AOSService\PackagesLocalDirectory\Bin>ModelUtil.exe -delete -metadatastorepath="C:\AOSService\PackagesLocalDirectory" -modelname="Application suite VAR model"   <press Enter>
Are you sure you want to delete model Application suite VAR model? (Y/N)
y

C:\AOSService\PackagesLocalDirectory\Bin>

Reply
Uzair Saleem responded on 11 Jun 2017 3:55 AM
My Badges
Suggested Answer

For model deletion use modelutil.exe delete command and delete the folder after stopping service. then build and sync.

For Package deletion on dev environment , just stop the AOS service, delete the package folder inside the PackagesLocalDirectory , then start service, build and sync.

Reply
Bharath Govinda responded on 30 Jan 2018 2:05 AM
Suggested Answer

Assuming that the package should be deleted from UAT/LIVE

1. Delete all the components from package and create deployable package out of it from DEV using VS.

2. Create a text file call “ModuleToRemove.txt” and put it into the AOSService\Scripts folder

3. In the text file, put in the name of the module you want to remove, for example – “MyModule”

4. Zip up the package and upload into the asset library

5. Apply the package in UAT/LIVE.

Reply
Bharath Govinda responded on 8 Mar 2018 7:30 AM
Suggested Answer

This looks like different question. Can you please ask it as a new one. Also, to tell answer in short you need to have changeset details, when you checked in the HOTFIX changes to VSTS. May be through that changeset you can compare the code and remove the code related to HOTFIX.

Reply
Mesut BOZTAŞ responded on 7 Nov 2018 7:41 AM
My Badges
Suggested Answer

Hi All,

ModelUtil.Exe delete method only delete Model file of package. the package is still shown on packagesLocalDirectory folder.

To delete package completely:

1- Stop IIS.(Aos machine)

2- Stop DynamicsAXBatch service on Task manager

3- Delete your package completely located on K:\AosService\packagesLocalDirectory (path can bey vary)

4-Open VS

5- Dynamics 365 --> Model management --> Refresh models

Reply

SBX - Two Col Forum

SBX - Migrated JS