When publishing customisations in CRM 2015 error generating UIData occurs - dynamics-crm-2015

Here is the error in full:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault,
Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:
Error generating UiDataDetail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147200969</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Error generating UiData</Message>
<Timestamp>2015-12-08T16:11:06.2411313Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
I have checked various solutions to this error. Solutions I have tried are to restart IIS, Restarted the services SQL and CRM, check any workflows are running

This was a process working in the background. Deactivate process, still couldn't publish all customizations from the solution top level, but could then export the solution into UAT which actually worked.

Related

Disable DOTNET_STARTUP_HOOKS in ASP.NET Core 5 web app

When deploying my ASP.NET Core 5 app (which targets .NET 5) to an Azure App Service, it throws a 502 error with the following details logged:
<Event>
<System>
<Provider Name=".NET Runtime"/>
<EventID>1026</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2021-07-12T08:58:41Z"/>
<EventRecordID>-2033762671</EventRecordID>
<Channel>Application</Channel>
<Computer>RD0003FF7ABC48</Computer>
<Security/>
</System>
<EventData>
<Data>Application: dotnet.exe
CoreCLR Version: 5.0.721.25508
.NET Version: 5.0.7
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException: Startup hook assembly 'C:\Program Files\dotnet\SDK\5.0.301\DotnetTools\dotnet-watch\5.0.301-servicing.21271.7\tools\net5.0\any\middleware\Microsoft.AspNetCore.Watch.BrowserRefresh.dll' failed to load. See inner exception for details.
---> System.IO.FileNotFoundException: Could not load file or assembly 'C:\Program Files\dotnet\SDK\5.0.301\DotnetTools\dotnet-watch\5.0.301-servicing.21271.7\tools\net5.0\any\middleware\Microsoft.AspNetCore.Watch.BrowserRefresh.dll'. The system cannot find the path specified.
File name: 'C:\Program Files\dotnet\SDK\5.0.301\DotnetTools\dotnet-watch\5.0.301-servicing.21271.7\tools\net5.0\any\middleware\Microsoft.AspNetCore.Watch.BrowserRefresh.dll'
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.StartupHookProvider.CallStartupHook(StartupHookNameOrPath startupHook)
--- End of inner exception stack trace ---
at System.StartupHookProvider.CallStartupHook(StartupHookNameOrPath startupHook)
at System.StartupHookProvider.ProcessStartupHooks()
</Data>
</EventData>
</Event>
The path that is not found corresponds to the environment variable that is being set in the web.config, which is set automatically by VisualStudio when I build the app:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<!--App settings needed to the Cloud media service library-->
<system.web>
<customErrors mode="off" />
</system.web>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" startupTimeLimit="3600" requestTimeout="23:00:00">
<environmentVariables>
<environmentVariable name="COMPLUS_ForceENC" value="1" />
<environmentVariable name="ASPNETCORE_HTTPS_PORT" value="8088" />
<environmentVariable name="ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT" value="ws://localhost:53593/MyWebApp/" />
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
<environmentVariable name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="Microsoft.AspNetCore.Watch.BrowserRefresh" />
<environmentVariable name="DOTNET_STARTUP_HOOKS" value="**C:\Program Files\dotnet\SDK\5.0.301\DotnetTools\dotnet-watch\5.0.301-servicing.21271.7\tools\net5.0\any\middleware\Microsoft.AspNetCore.Watch.BrowserRefresh.dll**" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
What is this environment variable used for? Can I disable its generation to allow the app run properly on the Azure App Service when deploying?
Thanks in advance.
Probably not the most fancy solution, but to manually delete the DLL referenced in the DOTNET_STARTUP_HOOKS environment variable in the web.config prevents VS to automatically set it over and over again.
Startup hooks are disabled by default on trimmed apps. Not sure if you're in the position to do app trimming, but if you could, that'd effectively disable startup hooks.
The main reason for this is explained here, and comes down to it being potentially dangerous to be run on trimmed apps.
Another, scarier way, would be to write yourself a global startup hook that disables local startup hooks to load. Of course, the simpler solution is to just make sure that that environment variable is not set in the first place.

Change BPF Stage with Workflow Dynamics CRM 2016

We are currently on Dynamics 2016 on premise. We are following this article to set up a workflow to change the Stage on one of our business process flows. The setup of our BPF is below. We are receiving the following error when the BPF runs. I've narrowed this error down to somewhere in the Update Contract Setup Stage step. What are we missing here? Perhaps we are trying to do something only available on D365? Other attempts at changing the stage on a BPF include using the Web API (issues detailed here) and using a trigger to set the database values (yes, we know this is not supported).
Error
Plugin Trace:
[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]
[UpdateStep3]
Error Message:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An unexpected error occurred.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ActivityId>bb2e54fb-674a-45b1-a715-3a61722ee875</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>An unexpected error occurred.</Message>
<Timestamp>2018-09-27T21:02:20.3406538Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>bb2e54fb-674a-45b1-a715-3a61722ee875</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #66095F59</Message>
<Timestamp>2018-09-27T21:02:20.3406538Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]
[UpdateStep3]
</TraceText>
</OrganizationServiceFault>
at Microsoft.Crm.Workflow.Services.UpdateActivityService.Execute(ActivityContext executionContext, UpdateEntity updateEntity)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Workflow Setup
Update Contract Setup Step
I'm not sure if you can do this directly, but i used in the past Dynamics Workflow Tools which have a lot of functions which you can call from a workflow. For BPF Stage you can use "Set Process Stage" Method.

Error registering Plugin Assembly for dynamics 365 crm online

I recently switched computers and had to clone my repo onto a new computer. Everything works fine, I get no build errors or warnings, however, when I go to run SPKL deploy plugins.bat, I get the following error:
I get error Code: -2147220970. Have no idea what that means.. If anyone could guide me on how I could gain back access to spkl as I need it for continuous integration!
Even the plugin registration tool (provided by sdk) shows the following error:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An unexpected error occurred.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ActivityId>56924dfd-6d03-4ac1-8e6b-d0341bc81da3</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>An unexpected error occurred.</Message>
<Timestamp>2018-09-15T02:11:55.2459404Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>56924dfd-6d03-4ac1-8e6b-d0341bc81da3</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.FormatException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #ED7531F1</Message>
<Timestamp>2018-09-15T02:11:55.2459404Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly)
at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick()
I changed the target framework to 4.5.2 and Microsoft.CrmSdk.CoreAssemblies and and Microsoft.CrmSdk.CoreTools to v8.2.0.2 and v8.2.0.5 respectively and BOOOM, it worked.
I guess you have to keep watch for the versions that the organization is currently using!

CRM 2016 - Ribbon Workbench - Error when Publish Solution: The User ID is Invalid

I am having this error when using RibbonWorkbench (latest version). When I click Publish, the progress dialog show this step: "Importing solution", then after few minutes, it throws this error:
Error when publishing Solution
RBW:3.1.177.1,CRM:8.2.0.749
Import Failed : Unhandled Exception: System.ServiceModel.FaultException [[Microsoft.Xrm.Sdk.osf, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: The user Id(s) [f3acea0e-57f3-4dcf-835a-48603998e79d] is invalid.Detail:
<osf xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ActivityId>53161f82-3291-4a32-a8ff-306cd84436e8</ActivityId>
<ErrorCode>-2147214049</ErrorCode>
<ErrorDetails xmlns:d2p1="">
<key>
<d2p1:key>0</d2p1:key>
<d2p1:value i:type="d4p1:string">f3acea0e-57f3-4dcf-835a-48603998e79d</d2p1:value>
</key>
</ErrorDetails>
<Message>The user Id(s) [f3acea0e-57f3-4dcf-835a-48603998e79d] is invalid.</Message>
<Timestamp>2017-11-21T07:15:18.3500676Z</Timestamp>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</osf>
Stack Trace:
Error:
at Function.ClientUI.ViewModel.EditCommandBarsVM.queryImport (:19555:1448)
at :19556:38
I faced this error when publishing any solution/entity. I created a new entity a try to Publish it in RibbonWorkbench, it always show the same error.
The user Id(s) [f3acea0e-57f3-4dcf-835a-48603998e79d] is invalid.
The user GUID is SYSTEM user in our environment.
Could you please show me where should I check this problem? I have googled this error without any result
Thank you very much!

How to solve Windows Azure Diagnostic Runtime Error (Could not create WindowsAzure.Diagnostics, Version=xx, Culture=neutral, PublicKeyToken=xx

privateLibManager libManager;
private LibManager Connect()
{
this.libManager=new LibManager();//here we are getting an error
}
Error:
The type initializer for 'SWConfigDataClientLib.LibManager' threw an exception
Inner Exception:
Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics,Version=2.2.0.0,Culture=neutral,
PublicKeyToken=31bf3856ad364e35.
Source
IpPbxCDSClientLib
First make sure you have added references to Microsoft.WindowsAzure.Diagnostics from the SDK folders (typically c:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\v2.2\ref\Microsoft.WindowsAzure.Diagnostics.dll)
Next, if you are not running your project in the emulator (i.e. the cloud project set as the startup project), then set the trace filter level to TraceEventType.Error or TraceEventType.None to avoid trying to write verbose Azure messages to the trace listener. In you web or app config:
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter level="TraceEventType.Error" />
</add>
</listeners>
</trace>
</system.diagnostics>
I had the same error.
I was missing a reference to Microsoft.WindowsAzure.Diagnostics
Ok So even I had this exception being thrown continuously. However, my case was a little different.
I wanted to get rid of this reference as it was no longer required in the project. So I removed it from the references. But while running the application, I started getting this exception at a Debug.WriteLine(...); statement which suggested that the reference was required.
On further analysis, I found that the below section was present in the project's app.config file which was the cause of the exception.
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
After removing the reference AND also removing the above section from config file, the issue got fixed.
Hope this helps!
Make sure you have added this reference to your project
Microsoft.Azure.Plugins.Diagnostics.dll

Resources