This has really confused me.
I have created a solution is Visual Studio 2013 for the package deployer using the template.
I have added my solution and put some code in the BeforeImportStage(), currently it is only:
IOrganizationService service = CrmSvc.OrganizationServiceProxy; EntityCollection orgs = service.RetrieveMultiple(new QueryExpression("organization") { ColumnSet = new ColumnSet("organizationid") }); Entity org = orgs.Entities.FirstOrDefault(); Guid _id = org.Id;
as I want to get this working before I get more complicated. Then I copy everything that's compiled to my test folder and everything from the 2016 SDK -> Tools -> Package Deployer (excluding the other languages).
At this point, I'm not sure which version of the files I should use where they match, those generated from the compilation or in the SDK? I've tried both but still get the following error when I try to run the deployer, which only occurs when I try to run custom code
"The pre-import process failed: Could not load file or assembly 'Microsoft.Xrm.Tooling.Connector, version 1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
I know this means the application is looking for one version of the Tooling.Connector dll and finding another but I don't know how to fix it.
I have tried removing the reference from the solution and adding it directly from the file I get from the SDK, then cleaning and rebuild but this doesn't work.