Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

"CachedAnonymousMethodDelegate" and exception

$
0
0

In our deployed application(in AFS), a call to a member function from another member function in thesame class is failing with an exception "absolute path information is required".

My locally build application is working fine. Our application is configured as "AnyCpu" and “Debug”. I have tried msbuild build in my machine using a 32 bit msbuild and 64 bit msbuild. In both cases the assembly created is running without a problem. So it is the build machine which is producing the problem dll

We thought we should find the core cause of the issue

Details:

The "problem" class.

 [Export("SomeName",
typeof(IDataPresenter))]
[PartCreationPolicy(CreationPolicy.NonShared)]
public class
SomeDataPresenter : MyDataPresenter
{  protected void
BeginFieldsWithDi(ReportFields reportDefinition) {    if(reportDefinition.ReportDimension != null)    {       
       reportDefinition.ReportDimension.ForEach(x =>x.LogicalName=_reportHelper.AddDiStart(x.LogicalName));    }    if(reportDefinition.ReportMeasure != null)    {      
reportDefinition.ReportMeasure.ForEach(x => x.LogicalName =
_reportHelper.AddDiStart(x.LogicalName));    }   }

protected override
bool UpdateReport(ReportFields reportDefinition, bool isReportExecution)
 {
//the following call is failing with exception"absolute path information is required".    
BeginFieldsWithDi(ReportFields reportDefinition); }
}

//the base classes just for clarity

[PartCreationPolicy(CreationPolicy.NonShared)]
public class
MyDataPresenter: BaseDataPresenter, IMyDataPresenter
{

}
 
[Export("DefaultReportDataPresenter", typeof(IDataPresenter))] 
[PartCreationPolicy(CreationPolicy.NonShared)] public class
BaseDataPresenter: Model, IBaseDataPresenter
{

}

For BeginFieldsWithDi() function the IL in my local machine and the deployed IL is different(Only the beginning part which is given below)

IL in my machine

.method family hidebysig instance void  RemoveDiFromFields() cil managed{  // Code size       119 (0x77)  .maxstack  3  .locals init ([0] class [mscorlib]System.Action`1<class [MyApp.Infra]ReportFieldsReportDimension> 'CS$<>9__CachedAnonymousMethodDelegatef',           [1] class [mscorlib]System.Action`1<class [MyApp.Infra]ReportMeasure> 'CS$<>9__CachedAnonymousMethodDelegate10',           [2] bool CS$4$0000)  IL_0000:  ldnull  IL_0001:  stloc.0  IL_0002:  ldnull  IL_0003:  stloc.1  IL_0004:  nop  IL_0005:  ldarg.0  IL_0006:  call       instance class [MyApp.Infra]ReportFields [MyApp.Modules.Ux]MyApp.Modules.Ux.Controls.VirtualGrid.Applications.Controllers.ReportDataPresenter::get_ColumnMetadata()
}

IL from deployed DLL

.method family hidebysig instance void  RemoveDiFromFields() cil managed
{  // Code size       119 (0x77)  .maxstack  3  .locals init (class [mscorlib]System.Action`1<class [MyApp.Infra]ReportFieldsReportDimension> V_0,           class [mscorlib]System.Action`1<class [MyApp.Infra]ReportMeasure> V_1,           bool V_2)  IL_0000:  ldnull  IL_0001:  stloc.0  IL_0002:  ldnull  IL_0003:  stloc.1  IL_0004:  nop  IL_0005:  ldarg.0  IL_0006:  call       instance class [MyApp.Infra]ReportFields [MyApp.Modules.Ux]MyApp.Modules.Ux.Controls.VirtualGrid.Applications.Controllers.ReportDataPresenter::get_ColumnMetadata()
}

Question: What causes the IL to generate “CachedAnonymousMethodDelegate” entry in my machine and does not in the build machine (which is deployed)? 

If we can deduct the cause of the exception("absolute path information is required") from above, what is it?





Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>