using Enterprise Library 4.1 Logging Block in Custom Workflow Acti

crm

    Sponsored Links

    Next

  • 1. Stop Pipeline Execution from Plugin
    I have some logic to check if an account creation is valid, and I need to cancel the creation if certain conditions are true. I created the plugin, registered it and it does all my check without a problem, but I don't know what the command is to stop the pipeline execution. The only thing that works is the exception and that will be shown to the user... I don't want it shown. Thanks, Eran
  • 2. What is Primary and Seconday Entity?
    Hi, What is Primary and Seconday Entity when registering a Plug-in? What is Parent Pipeline and Child Pipeline? Can u please expaling with some easy example. Thanks in Advance. Thanks & Regards, Ranjit
  • 3. Urgent Issue:Error on form save while saving dynamic picklist opti
    Hi all, I have an picklist in my custom entity and I want to fill it dynamically using Javascript. Problem is that when i select an option from picklist and click on save entity button i get error message like this "one or more of the option values for this picklist are not in the range of allowed values". if i leave unselected picklist then it doesn't show any error message. I have taken DataValue as numeric and within the range of 1 to 2,147,483,646 as specified by CRM. Can anyone suggest me what is the problem? It's urgent, Kindly reply me as soon as possible. Thanks in advance.
  • 4. CRM4 - How to retrieve Records per Page options?
    Hi there, Anyone knows how to retrieve Records per Page setting? Thanks heaps. -- - Henri

using Enterprise Library 4.1 Logging Block in Custom Workflow Acti

Postby ZG9taW5pa19odWc » Wed, 22 Jul 2009 22:59:01 GMT

i all

I want to use the Enterprise Library 4.1 Logging Block to make the tracing
in a Custom Workflow Activity (CWA).
I have written a CrmAsyncService.exe.config as configuration file (reading
settings out of this file from a CWA works.

In the project I referenced the
Microsoft.Practices.EnterpriseLibrary.Logging.dll with "Copy Local" set to
true. In the Windows Explorer in the properties of the assembly I can see
that it is a signed assembly.

I copied the assembly Microsoft.Practices.EnterpriseLibrary.Logging.dll
along with
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.ObjectBuilder2.dll
Microsoft.Practices.Unity.dll
in the bin\assembly folder of CRM.

But every time the CWA ist executed I have the following error in the trace
output of CRM:

[2009-07-21 14:52:26.9] Process:CrmAsyncService
|Organization:a6cc8da2-b53a-47b8-b732-ffa29982cfb1 |Thread: 4 |Category:
Platform.Workflow |User: 00000000-0000-0000-0000-000000000000 |Level: Error |
WorkflowHost.OnWorkflowTerminated
at WorkflowHost.OnWorkflowTerminated(Object sender,
WorkflowTerminatedEventArgs args)
at WorkflowRuntime.OnScheduleTerminated(WorkflowExecutor schedule,
WorkflowTerminatedEventArgs args)
at WorkflowRuntime.WorkflowExecutionEvent(Object sender,
WorkflowExecutionEventArgs e)
at EventHandler`1.Invoke(Object sender, TEventArgs e)
at WorkflowExecutor.FireWorkflowTerminated(Exception exception)
at SchedulerLockGuard.FireEvents(List`1 eventList, WorkflowExecutor
workflowExec)
at SchedulerLockGuard.Dispose()
at WorkflowExecutor.RunSome(Object ignored)
at WorkItem.Invoke(WorkflowSchedulerService service)
at DefaultWorkflowSchedulerService.QueueWorkerProcess(Object state)
at _ThreadPoolWaitCallback.WaitCallback_Context(Object state)
at ExecutionContext.runTryCode(Object userData)
at RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code,
CleanupCode backoutCode, Object userData)
at ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback
callback, Object state)
at
_ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback
tpWaitCallBack)
at _ThreadPoolWaitCallback.PerformWaitCallback(Object state)
File name: 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at
System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host, String typeString, Boolean throwOnError)
at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord
configRecord, FactoryRecord factoryRecord)
at
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory..ctor(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
at
System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)
at
System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\NETWORK SERVICE
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary

RE: using Enterprise Library 4.1 Logging Block in Custom Workflow Acti

Postby ZG9taW5pa19odWc » Fri, 24 Jul 2009 00:36:01 GMT

found the solution my self:

Adding
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="assembly"/>
</assemblyBinding>
</runtime>
to the CrmAsyncService.exe.config helped.
Interestingly in the Plugins and CustomWorkflowActities I also reference an
assembly
I developed my self and the calling assembly managed to locate it (without
the probing element).

"dominik_hug" wrote:


Similar Threads:

1.CRM Callouts & Microsoft Enterprise Library Application Blocks

We are writing a callout for a project and we would like to use the Microsoft 
Enterprise Library (MEL) for configuration, logging, and data access.  It is 
our enterprise standard to utilize those blocks for those activities on all 
of our efforts.  The problem is that I don't see a readily available 
app.config or web.config file for which I can add the configuration context 
necessary to utilize those features.

I also am very averse to modifying any core Microsoft Dynamics CRM 3.0 
app.config or web.config file because it has the potential of being wiped out 
during any future upgrades.  So far we have envisioned two options but would 
like some community feedback to help us define a best practice.

Option 1: Use the MEL ConfigurationManager to load context from a file and 
execute against that context
PRO: It seems as if it may get us closer 
CON: Externally loaded context does not become the "current context".  
Existing in-house libraries hard-wired to execute against the "current 
context" may not be utilized.

Option 2: Add the configuration context to the machine.config
PRO: We may utlize all existing in-house libraries 
CON: We have a standard to not use the machine.config for anything to avoid 
potential maintenance headaches.

We are leaning towards [Option 2] and changing our standard to allow 
authorized modifications to the machine.config only.  This is because we 
enjoy leveraging the current context in our core libraries to avoid having to 
pass context and configuration information through every layer of our code.


2.is it possible to have a multiple Lookup in a custom Workflow acti

3.How to get logged in user GUID in custom component using mscrm 3.0

I am using this code to retrive GUID but it's always return same GUID of 
system user(named SYSTEM in the systemuserbase table).

CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

WhoAmIRequest userRequest = new WhoAmIRequest();
WhoAmIResponse user = (WhoAmIResponse) service.Execute(userRequest);
String loggedInUserId = user.UserId.ToString();

I think it is the case of setting the impersonation in the CRM web.config 
and the corresponding application web.config.

Any suggestion would be helpful.

4.How to get logged in user GUID in custom component using mscrm

Hi Tibor,

Thanks for your reply. As you written in step 1 impersonate your user that i 
already done through web.config(<identity impersonate="true" />)

Please explain these steps in some more detail. If you have any sample code 
regarding to this thats is very helpful for me.

Many thanks for your help.

Kedar N. Kumar

"Tibor" wrote:

> Hi Kumar,
> 
> you can use service.caller.callerguid to get/set this property.
> But the call-outs are running under the name of NT AUTHORITY\Network Service 
> = (SYSTEM)
> You can do the following:
> - imersonate your user user using the Credentialcache
> - find you user through crm webservice in the database
> - retrieve the id of your user
> - log this id.
> 
> Regards,
> Tibor
> 
> "Kedar Nath Kumar" wrote:
> 
> > I am using this code to retrive GUID but it's always return same GUID of 
> > system user(named SYSTEM in the systemuserbase table).
> > 
> > CrmService service = new CrmService();
> > service.Credentials = System.Net.CredentialCache.DefaultCredentials;
> > 
> > WhoAmIRequest userRequest = new WhoAmIRequest();
> > WhoAmIResponse user = (WhoAmIResponse) service.Execute(userRequest);
> > String loggedInUserId = user.UserId.ToString();
> > 
> > I think it is the case of setting the impersonation in the CRM web.config 
> > and the corresponding application web.config.
> > 
> > Any suggestion would be helpful.

5.Word templates using WSS as document library

6. Outbound email blocked as SPAM when using the CRM4.0 router

7. Custom Libraries in CRM4.0

8. Calling assembly from workflow - blocking problem?



Return to crm

 

Who is online

Users browsing this forum: No registered users and 69 guest