DawidPotgieter / Dynamics-CRM-Binary-Storage-Options

A Dynamics CRM plugin to transparently store attachment binaries outside CRM database. Azure Blob or File storage for instance.
GNU Affero General Public License v3.0
34 stars 15 forks source link

Problem with IfdSelected variable in Migrate Solution #9

Closed san-86 closed 6 years ago

san-86 commented 6 years ago

I have tried to run a migration against a Online 8.2 instance, at first the migrate program found nothing to move, I then tried to debug the application and found that it chose a wrong OrganizationServiceProxy,

the code that creates the problem is : private bool IfdSelected { get { bool value = false; if (rdoIFDAuth.InvokeRequired) { rdoIFDAuth.BeginInvoke(new MethodInvoker(delegate { value = rdoIFDAuth.Checked; })); } else { value = rdoIFDAuth.Checked; } return value; } } and the place where it's used if (IfdSelected) { localProxy = new OrganizationServiceProxy(serviceManagement, authCredentials.SecurityTokenResponse); } else { localProxy = new OrganizationServiceProxy(serviceManagement, authCredentials.ClientCredentials); }

When the IfdSelected is used the BeginInvoke is called as it should but the value returned is still false, so the local Proxy will use the wrong Authentication method and fail several places in the migrate program.

I have fixed it by setting it to use the SecurityTokenResponse Auth everytime but a better way could probably be found.

DawidPotgieter commented 6 years ago

I have tried to replicate this, but I can't seem to find the issue you're experiencing.

Are you saying that if you tick the "IFD" tickbox, that rdoIFDAuth.Checked returns false? Seems very odd, as that's just making sure that the code is being called on the correct thread.

What .net framework are you running (and which version of the CRM sdk)? That's the only thing I can think of to still try to replicate the issue.

Cheers.

DawidPotgieter commented 6 years ago

Hi there,

Is this still an issue, or can I mark it as resolved?

Thanks.

san-86 commented 6 years ago

Hi ,

You can close it

Thank you.


Fra: Dawid Potgieter notifications@github.com Sendt: 7. juni 2018 22:33 Til: DawidPotgieter/Dynamics-CRM-Binary-Storage-Options Cc: Soeren Andersen; Author Emne: Re: [DawidPotgieter/Dynamics-CRM-Binary-Storage-Options] Problem with IfdSelected variable in Migrate Solution (#9)

Hi there,

Is this still an issue, or can I mark it as resolved?

Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDawidPotgieter%2FDynamics-CRM-Binary-Storage-Options%2Fissues%2F9%23issuecomment-395555639&data=02%7C01%7C%7Cf5e83d643d654a65adf708d5ccb5ff38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636640004391562094&sdata=CntjCuTB8NLKoF%2BS8Ytn%2Fe67eNm%2B7eThlLnhIjUYf8g%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAcA5brwVJgbIQA_vMJW47XQ7xckPFn2wks5t6Y42gaJpZM4TyfT-&data=02%7C01%7C%7Cf5e83d643d654a65adf708d5ccb5ff38%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636640004391562094&sdata=P2Ga%2Btbl0dU38CShZtde89KhjW283%2F5ppHafxTvEjTM%3D&reserved=0.

DawidPotgieter commented 6 years ago

Thanks.

Would you mind providing the answer to the problem, just in case someone else runs into something similar?

Cheers.

san-86 commented 6 years ago

I changed the code to check un check the button Ifdselected and then it worked, it was very odd