When should I use "Refresh models" and when "Build solution"?

D365 Two dev virtual machines and a Version control
I have sone some development in VM1 and now I’m connected to VM2.
I did getLatest*() on VM2, but even though the code is there (I can see it when I open my project on the VM2), I don’t see my new menu item when I open D365 in the browser.
So I guess the problem is that the code was not recompiled on VM2
Is it so? I’e after getLatest I need to recompile it?
If so, then should I do refresh models or should I do Rebuild solution? (I’m aftraid that rebuild solution willl rebuild only my project, not all the projects/code that were not compiled yet on VM2)

Yes, you need to compile code. The running application doesn’t execute source code; it executes binaries such as DLL files. If you don’t compile your code, the application still uses binaries from your last compilation. The fact that source has changed has no impact on the runtime.

To compile the whole model, not just your solution, use Dynamics 365 > Build models.

Refresh models isn’t relevant to your situation. You’d use it if you got a completely new model from source control and you’d want to load it without restarting Visual Studio. If you just get code changes in an existing model, you don’t need any refresh of the list of models.

1 Like

Thank you very much for the detailed answer Martin!