哈爾濱網(wǎng)站建設(shè)教程seo站長助手
一、修改錯誤
昨天登錄報錯

今天開始返回我之前設(shè)置的斷點開始重新配置,Reporing Services配置完成后發(fā)現(xiàn)dynamics365還是下載失敗
之后下載了一上午dynamics365就一直卡在最后的界面進(jìn)度條不動
索性我直接把所有環(huán)境都卸載了 連同虛擬機卸載重裝
終于在下午的時候dynamics365貌似下載成功了

SSRS也出現(xiàn)了
然后下載SSRS

就按照提示下載

安裝完成

二、創(chuàng)建插件項目
官方文檔:教程:編寫和注冊插件 (Microsoft Dataverse) - Power Apps |微軟學(xué)習(xí)
為插件創(chuàng)建 Visual Studio 項目
打開Visual Studio并使用.NET Framework 4.6.2打開一個新的類庫(.NET Framework)項目
去下載.Net Framwork4.6.2
下載網(wǎng)址:https://dotnet.microsoft.com/zh-cn/download/dotnet-framework/net462

安裝成功

1、新建一個類庫項目
.Net Framwork 4.6.2

2、下載程序包
通過Nuget包管理器下載:
Microsoft.CrmSdk.CoreAssemblies
Microsoft.Crm.Sdk.Proxy.2015
Microsoft.Xrm.Sdk.2015
Microsoft.XRM.SDK.2015.OnPremise

額外補充的兩個Nuget包:
Microsoft.CrmSdk.Deployment(沒成功)
Microsoft.CrmSdk.Workflow
下載程序集

3、實現(xiàn) IPlugin 接口
通過編輯類來實現(xiàn) IPlugin 接口

將該方法的內(nèi)容替換為以下代碼:Execute
// Obtain the tracing service
ITracingService tracingService =
(ITracingService)serviceProvider.GetService(typeof(ITracingService));// Obtain the execution context from the service provider.
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));// The InputParameters collection contains all the data passed in the message request.
if (context.InputParameters.Contains("Target") &&context.InputParameters["Target"] is Entity)
{// Obtain the target entity from the input parameters. Entity entity = (Entity)context.InputParameters["Target"];// Obtain the organization service reference which you will need for // web service calls. IOrganizationServiceFactory serviceFactory =(IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);try{// Plug-in business logic goes here. }catch (FaultException<OrganizationServiceFault> ex){throw new InvalidPluginExecutionException("An error occurred in FollowUpPlugin.", ex);}catch (Exception ex){tracingService.Trace("FollowUpPlugin: {0}", ex.ToString());throw;}
}
該插件將創(chuàng)建一個任務(wù)活動,該活動將提醒帳戶的創(chuàng)建者在一周后跟進(jìn)。
將以下代碼添加到 try 塊。替換注釋:。與以下內(nèi)容:// Plug-in business logic goes here
// Create a task activity to follow up with the account customer in 7 days.
Entity followup = new Entity("task");followup["subject"] = "Send e-mail to the new customer.";
followup["description"] ="Follow up with the customer. Check if there are any new issues that need resolution.";
followup["scheduledstart"] = DateTime.Now.AddDays(7);
followup["scheduledend"] = DateTime.Now.AddDays(7);
followup["category"] = context.PrimaryEntityName;// Refer to the account in the task activity.
if (context.OutputParameters.Contains("id"))
{Guid regardingobjectid = new Guid(context.OutputParameters["id"].ToString());string regardingobjectidType = "account";followup["regardingobjectid"] =new EntityReference(regardingobjectidType, regardingobjectid);
}// Create the task in Microsoft Dynamics CRM.
tracingService.Trace("FollowupPlugin: Creating the task activity.");
service.Create(followup);
這里運行發(fā)現(xiàn)報錯了

去下載.Net Framwork4.5.2
下載地址:下載 .NET Framework 4.5.2 Developer Pack Offline Installer (microsoft.com)

然后重復(fù)上邊的步驟
4、對插件進(jìn)行簽名
1、在“解決方案資源管理器”中,右鍵單擊 BasicPlugin 項目,然后在上下文菜單中選擇“屬性”。
2、在項目屬性中,選擇“簽名”選項卡,然后選中“為程序集簽名”復(fù)選框。

3、在“選擇強名稱密鑰文件:”下拉列表中,選擇<新建...>。
在“創(chuàng)建強名稱密鑰”對話框中,輸入密鑰文件名并取消選中“使用密碼保護(hù)我的密鑰文件”復(fù)選框。

5、單擊“確定”關(guān)閉“創(chuàng)建強名稱密鑰”對話框。
6、在項目屬性“生成”選項卡中,驗證“配置”是否設(shè)置為“調(diào)試”。
7、按 F6 再次生成插件。
8、使用 Windows 資源管理器,在以下位置找到內(nèi)置插件:。\bin\Debug\BasicPlugin.dll

5、注冊程序集
一、在“注冊”下拉列表中,選擇“新建程序集”。
選擇第一個

二、在“注冊新程序集”對話框中,選擇省略號 (...) 按鈕并瀏覽到在上一步中生成的程序集。

三、單擊注冊所選插件。

四、您將看到“已注冊插件”確認(rèn)對話框。

五、單擊“確定”關(guān)閉對話框并關(guān)閉“注冊新程序集**”**對話框。
您現(xiàn)在應(yīng)該看到(程序集)BasicPlugin 程序集,您可以展開該程序集以查看(插件)BasicPlugin.FollowUpPlugin 插件。

三、打開虛擬機
雙擊Demo

然后進(jìn)入一個網(wǎng)頁 把網(wǎng)址復(fù)制下來去主機登錄
進(jìn)不去就等會 反復(fù)試試
