Posted 7 June 2023, 3:40 am EST
Hi
I’m having a strange issue where a subset of my reports are not loading in the .NET viewer when run from the deployed application. When running the application locally through Visual Studio I have no issues at all with viewing any of the reports I have generated. But when testing the reports through a deployed version of the application we noticed that a large subset of reports do not load in the Viewer and instead we see an error message:
Exception details:
System.ArgumentException: Empty path name is not legal. (Parameter 'path')
at System.IO.Strategies.FileStreamHelpers.ValidateArguments(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Roslyn.Utilities.StandardFileSystem.OpenFile(String filePath, FileMode mode, FileAccess access, FileShare share)
at Roslyn.Utilities.CommonCompilerFileSystemExtensions.OpenFileWithNormalizedException(ICommonCompilerFileSystem fileSystem, String filePath, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
at GrapeCity.ActiveReports.Core.Scripting.CodeCompiler.GenerateVBCode(String sourceCode)
at GrapeCity.ActiveReports.Core.Scripting.CodeCompiler.GenerateCode(Language language, String sourceCode)
at GrapeCity.ActiveReports.Core.Scripting.CodeCompiler.TryCompile(Language language, String sourceCode, String[] references, IAssemblyLoader loader, Assembly& assembly, IEnumerable`1& compilationResults, Boolean enableDebug)
at GrapeCity.ActiveReports.SectionReport..TryCompile(Language language, String sourceCode, String[] references, Assembly& assembly, IEnumerable`1& compilationResults, Boolean enableDebug)
at GrapeCity.ActiveReports.SectionReport..GrapeCity.ActiveReports.IScriptCompiler.TryCompile(Language language, String sourceCode, String[] references, Assembly& assembly, IEnumerable`1& compilationResults, Boolean enableDebug)
at GrapeCity.ActiveReports.Internal..Compile()
at GrapeCity.ActiveReports.Internal..ExecuteMethod(String methodName, Object[] parameters, Boolean& success)
at GrapeCity.ActiveReports.SectionReport.ProcessInit(Boolean bDelayedInit)
at GrapeCity.ActiveReports.SectionReport.RunImpl(Boolean syncDocument)
at GrapeCity.ActiveReports.SectionReport.Run(Boolean syncDocument)
at GrapeCity.ActiveReports.Viewer.Common.Internal.RpxReport.LoadDocument(SectionDocument document)
at GrapeCity.ActiveReports.Viewer.Common.Internal.RdfDocumentReportBase..<LoadImpl>b__4()
at GrapeCity.ActiveReports.Viewer.Common.Internal...<DoAsync>b__2(Object <p0>, DoWorkEventArgs <p1>)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
When trying to determine the source of the error I found that if I open one of these reports, go to the scripting tab, and delete all code in there the report will start to load correctly in the viewer. If I then go back and add any amount of code, even a single line just importing a standard library then this error will return. Having scripting is not exclusive to these reports, I have other reports with scripting as well that do not have this issue.
Very confused about what is causing this as there is nothing really exclusive to these reports that set them apart from the others.