19 October 2019

DevOps Error: Process 'msbuild.exe' exited with code '1'.

If the build pipeline fails directly after it has startet with the build error: Process 'msbuild.exe' exited with code '1'. This can have multiple reasons. To do the build it requires the AXModulesBuild.proj
So first of all check the folder in the error message. If you are using another folder, different branch,... go to the build pipeline and check the projects path:




Error Message:

Starting: Build the solution
==============================================================================
Task : MSBuild
Description : Build with MSBuild
Version : 1.151.1
Author : Microsoft Corporation
==============================================================================
"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" "C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj" /nologo /nr:false /t:"Clean" /dl:CentralLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=a80b24ca-30a5-4568-b3f7-2c165ff76fec|SolutionDir=C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\DEV"*ForwardingLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:OutputPath="C:\DynamicsSDK\VSOAgent\_work\1\Bin" /p:LogPath="C:\DynamicsSDK\VSOAgent\_work\1\Logs" /p:platform="Any CPU" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_5a5acfcb-fe8b-4039-99f2-cadc61c1646d_build_21_0"
MSBUILD : error MSB1009: Project file does not exist.
Switch: C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj
##[error]Process 'msbuild.exe' exited with code '1'.
"C:\Program Files (x86)\MSBuild\14.0\bin\amd64\msbuild.exe" "C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj" /nologo /nr:false /dl:CentralLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=d2221e15-48e9-44a2-a294-5c21c60dcaa6|SolutionDir=C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV"*ForwardingLogger,"C:\DynamicsSDK\VSOAgent\_work\_tasks\MSBuild_c6c4c611-aa2e-4a33-b606-5eaba2196824\1.151.1\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:OutputPath="C:\DynamicsSDK\VSOAgent\_work\1\Bin" /p:LogPath="C:\DynamicsSDK\VSOAgent\_work\1\Logs" /p:platform="Any CPU" /p:configuration="Release" /p:_MSDeployUserAgent="VSTS_5a5acfcb-fe8b-4039-99f2-cadc61c1646d_build_21_0"
MSBUILD : error MSB1009: Project file does not exist.
Switch: C:\DynamicsSDK\VSOAgent\_work\1\s\$\D365\Trunk\DEV\AXModulesBuild.proj
##[error]Process 'msbuild.exe' exited with code '1'.
Finishing: Build the solution

09 October 2019

Unblock multiple files with PowerShell

Because I always forget to unblock files before I extract the zip files from Microsoft: Here is a PowerShell command to do it after the zip is extracted and a whole bunch of files are blocked

dir -Path .\FinanceAndOperations_10.0.136.10007_Application\ -Recurse | Unblock-File

this is definitely faster then deleting all the files and extracting again.

06 March 2019

D365 F&O version 10 - new build features

Great new from Microsoft regarding the build and deployment features in D365 F&O Version 10:

"the build automation framework will not require a VM and will solely rely on Azure DevOps build capabilities."

So we need to no longer manage build environments :)
and the next one is even better. Finally there will be an integration between DevOps and LCS. After uploading hundreds of deployable packages to LCS this might be automated in the future.

"Builds that are release candidates can be automatically deployed to LCS and sandbox cloud environments."

I hope that this will be available soon :)

13 February 2019

General form guidelines :)

Just because I always forget this link:
https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/user-interface/general-form-guidelines

07 December 2018

D365 F&O | UserInfo script to update networkDomain, IdentityProvider and SID for all users after DB copy

This runable class is really helpful when you copy a DB between environments with different tenants, different ADFS instances or if you messed up the SIDs 


using Microsoft.Dynamics.ApplicationPlatform.Environment;

class TWIXUserInfoUpdate
{           
    public static void main(Args _args)
    {     
        UserInfo            updateUserInfo;       
        NetworkDomain       updatedNetworkDomain;

        // Get network domain
        updatedNetworkDomain = EnvironmentFactory::GetApplicationEnvironment().get_Provisioning().get_AdminIdentityProvider();
       
        ttsbegin;
        TWIXUserInfoUpdate::callInsertUpdateRelatedSkipMethods(updateUserInfo);

        // Update network alias and network domain for all non admin users
        update_recordset updateUserInfo
            setting 
                networkDomain = updatedNetworkDomain,
IdentityProvider = updatedNetworkDomain
            where updateUserInfo.id != 'Admin' 
               && updateUserInfo.isMicrosoftAccount == 0
               && updateUserInfo.accountType == UserAccountType::ClaimsUser;
              
// Update SID
        while select forupdate updateUserInfo
            where updateUserInfo.id != 'Admin'
               && updateUserInfo.networkAlias
               && updateUserInfo.networkDomain == updatedNetworkDomain
               && updateUserInfo.isMicrosoftAccount == 0
               && updateUserInfo.accountType == UserAccountType::ClaimsUser
        {            
            AxaptaUserManager manager = new AxaptaUserManager();
            xAxaptaUserDetails userDetails = 
                        manager.getSIDFromName(updateUserInfo.networkAlias, updatedNetworkDomain, updateUserInfo.accountType);
            updateUserInfo.sid = userDetails.getUserSid(0);
            updateUserInfo.update();           
        }
        ttscommit;
       
    }

    public static void callInsertUpdateRelatedSkipMethods(Common _buffer)
    {
        //BP deviation documented
        _buffer.skipAosValidation(true);
        _buffer.skipDatabaseLog(true);
        _buffer.skipDataMethods(true);
        //needed in case of crossCompany
        _buffer.skipEvents(true);
    }
}

30 November 2018

D365 F&O | Sync DB timeout error

When the db sync of a D365 environment fails with a timeout error like the following:

AOS database sync failed. Microsoft.Dynamics.AX.Framework.Database.TableSyncException: Full sync did not complete successfully. Error: One or more errors occurred. 
...
SqlException:Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

You should check if the environment has enough ressources. Monitor the availbale CPU, RAM and disk speed. In some cases a simple reboot might help. If you are facind this error in a VM running on your laptop assign more than one core to the VM ;)

28 November 2018

D365 F&O | Change DevOps Build Agent

When you are managing more than one Microsoft Dynamics 365 for Finance and Operations environment throught DevOps (alias VSTS) it is a good idea to seperate the build agents into different build agent pools.
Creating a new agentpool in DevOps is quite simple but how do we change the link between the VSTSAgent which is running on the D365 box and the agent pool.

First of all create an AccessToken within DevOps as shown below:

After that connect to the D365 F&O server and navigate to C:\DynamicsSDK. There you will find a file named SetupBuildAgent.ps1. Create a copy of this file and open it in your favorite editor. Here we need to change two parameters:
AgentPoolName = "YourAgentPoolName"
VSOAccessToken = "YourNewlyCreatedToken"


After that we need a PowerShell which is running in admin mode. Execute your SetupBuildAgentXYZ.ps1 file and provide the base URL of the DevOps project collection


Finally you can check the agent pools in DevOps and you'll see that the Agent is now part of the agentPool you defined.