Posted 28 May 2026, 1:07 pm EST
Hello,
I’m getting the following error when instantiating a SectionReport object.
System.UnauthorizedAccessException: Access to the path ‘.data’ is denied.
at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, NamedWaitHandleOptionsInternal options, Boolean& createdNew)
at System.Threading.Mutex…ctor(Boolean initiallyOwned, String name)
at GrapeCity.ActiveReports.Internal..ReadFile(String dir, String fileName)
at GrapeCity.ActiveReports.Internal..CreateInstanceData()
at GrapeCity.ActiveReports.Internal..LoadProduct(String folder)
at GrapeCity.ActiveReports.Internal..GetDesignTimeLicenseCore(String code)
at GrapeCity.ActiveReports.Internal..GetDesignTimeLicenseWithCache(String feature, productDescriptor)
at GrapeCity.ActiveReports.Internal..GetDesignTimeLicense(String feature, productDescriptors)
at GrapeCity.ActiveReports.Internal.
1.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions) at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey) at System.ComponentModel.LicenseManager.Validate(Type type, Object instance) at GrapeCity.ActiveReports.SectionReport.<>c__DisplayClass492_0.<GetLicense>b__0(Boolean _) at GrapeCity.ActiveReports.AssertionHelper.<>c__DisplayClass0_0.<ExecuteWithMemberAccessAssert>b__0(Boolean access) at GrapeCity.ActiveReports.AssertionHelper.ExecuteWithAssert(CodeAccessPermission permission, Action1 action)at GrapeCity.ActiveReports.AssertionHelper.ExecuteWithMemberAccessAssert(Action`1 action)
at GrapeCity.ActiveReports.SectionReport.GetLicense(Object obj)
at GrapeCity.ActiveReports.SectionReport.ValidateLicense()
at GrapeCity.ActiveReports.SectionReport…ctor(SectionDocument document)
at GrapeCity.ActiveReports.SectionReport…ctor()
This is the code I’m currently testing:
using (var report = new SectionReport())
{
string rpxPath = Path.Combine(Directory.GetCurrentDirectory(), "Reports", "TestReport.rpx"); using (var xmlReader = new XmlTextReader(rpxPath)) { report.LoadLayout(xmlReader); } report.DataSource = data; report.Run(); var exporter = ReportExporterFactory.CreateExporter(ExportType.PDF); return exporter.Export(report.Document);
}
Where does it try to create this .data file? When I run VS as Admin, I still get the same error. Can someone point me in the right direction?
Thanks!
-Brian
