Getting error on CRM 2011 Plugin: “Invalid URI: The hostname could not be parsed.”

南楼画角 提交于 2019-12-08 13:29:45

问题


I have a plugin that works on different boxes on different domains. However, I have it registered on one particular box that continues to throw this error every time the applicable entity event is triggered. The caveat? The code isn't even being executed. IE: The IPlugin.Execute() interface implementation is never reached. I just get the CRM dialog indicating "Invalid URI: The hostname could not be parsed." every time.

I've confirmed the code isn't being entered as I've attached Visual Studio to the applicable CRM processes. On the other boxes I can step in and through with no issues. This is how I determined the code isn't being reached.

The plugin has been registered in the CRM the same as it is on the other machines. I've placed it underneath a particular Solution file and published (even though that step isn't necessary).

Thoughts?


回答1:


I figured it out. I also figured it would be idiotic in nature once I figured it out.

Summary: Unregister old, deprecated plugins.

Details:

This was a rewrite of a previously developed plugin (separate codebase), both of which are wrappers around a third-party web call. The third-party in question refactored their old-timey SOAP endpoint to a REST/JSON call. The SOAP call was officially taken offline on 1/15/13. AND...wait for it...the old plugins were still registered.

So, the error you see above was being thrown by the old plugins after the SOAP endpoint was officially deprecated.

The compounded problem? Since there were two IPlugin.Execute() interfaces wired to the same Entity.Event combination, I couldn't step into my code to debug. Now that the old plugins have been unregistered, it steps in immediately as expected.

The frosting on the cake? The execution of those two Execute() methods appeared to be completely nondeterministic. IE: Sometimes my new code would run (to a point), and sometimes it wouldn't. So either both Execute() methods were being run at the same time or one would be called before the other sometimes and vice-versa.

I won't soon forget this one. Thanks to all you guys who commented above. I actually attempted the fresh creation of an empty plugin, but it obviously rendered the same results. Hopefully this'll help someone someday.



来源:https://stackoverflow.com/questions/14508060/getting-error-on-crm-2011-plugin-invalid-uri-the-hostname-could-not-be-parsed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!