cancel
Showing results for 
Search instead for 
Did you mean: 

VB.NET program requires administrator for Crystal Reports after install

0 Kudos

I have a VB.NET app that utilizes Crystal Reports.

The program runs fine in Visual Studio and runs for me on any computer I have admin for. For users without admin rights, it crashes and says "Load report failed." immediately upon load.

I don't think it's the issue of it not being able to load a report, if I put a msgbox as first line in my code, it doesn't make it that far.

I have read and tried several fixes; most point seem to point toward the Windows temp folder or some other permission.

Could someone point me in the right direction? VS2019, Crystal 13.0.31.4010

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

The EXE is to install on your development PC, it's looking for Visual Studio.

MSI's are for runtime deployment only, don't install them on your Dev PC.

CR runtime is set for your app platform, x86 or x64, don't use AnyCPU, MSIExec will detect the OS platform and install accordingly which is always the 64 bit runtime because 99% of the people are using 64 bit Widows.

Answers (9)

Answers (9)

0 Kudos

Also, not sure if this helps, this is the output from the error logs:

If we use your .EXE for the .NET framework:

Application: myApp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.COMException
   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(System.Object ByRef, Int32)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(System.Object ByRef, Int32)
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

Exception Info: CrystalDecisions.Shared.CrystalReportsException
   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(System.String, CrystalDecisions.Shared.OpenReportMethod, Int16)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(System.String)
   at CrystalDecisions.ReportSource.NonHTTPCachedReportSource.GetReport(CrystalDecisions.Shared.RequestContext, Boolean)
   at CrystalDecisions.ReportSource.LocalReportSourceBase.GetAvailableExportFormats(CrystalDecisions.Shared.ExportRequestContext)
   at CrystalDecisions.Windows.Forms.ViewerDocument.GetAvailableExportFormats()
   at CrystalDecisions.Windows.Forms.PageView.CreateReportDocument(System.String)
   at CrystalDecisions.Windows.Forms.PageView.CreateNewReportDocument(System.String)
   at CrystalDecisions.Windows.Forms.CrystalReportViewer.CreateReportSource(System.Object)
   at CrystalDecisions.Windows.Forms.CrystalReportViewer.set_ReportSource(System.Object)
   at myApp.CrystalReport.InitializeComponent()
   at myApp.CrystalReport..ctor()
   at myApp.Form_Main..ctor()

Exception Info: System.InvalidOperationException
   at myApp.My.MyProject+MyForms.Create__Instance__[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
   at myApp.My.MyProject+MyForms.get_Form_Main()
   at myApp.My.MyApplication.OnCreateMainForm()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(System.String[])
   at myApp.My.MyApplication.Main(System.String[])

If we use the .MSI for the .NET framework:

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.BadImageFormatException
   at CrystalDecisions.Shared.SharedUtils..cctor()

Exception Info: System.TypeInitializationException
   at CrystalDecisions.Shared.SharedUtils.get_CurrentControl()
   at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()
   at CrystalDecisions.Shared.LocaleManager..ctor()
   at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()
   at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()
   at myApp.CrystalReport.InitializeComponent()
   at myApp.CrystalReport..ctor()
   at myApp.Form_Main..ctor()

Exception Info: System.InvalidOperationException
   at myApp.My.MyProject+MyForms.Create__Instance__[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)
   at myApp.My.MyProject+MyForms.get_Form_Main()
   at myApp.My.MyApplication.OnCreateMainForm()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(System.String[])
   at myApp.My.MyApplication.Main(System.String[])
0 Kudos

Hi Don,

We're trying different security settings.

I did notice you mentioned MSI. I've been installing the .EXE of the .NET libraries from your site.

I tried uninstalling the .EXE and installing the .MSI. when I do so, our application starts and immediately ends with no pop up error.

Should we use the .MSI or the .EXE?

0 Kudos

Try repairing the MSI install, log in as the local PC Admin, likely works for you because the installer used your credentials to create the various Registry keys and registered the various COM dll's.

I don't recall the name but there is a Windows Service the IT guys can use to push out software, they can elevate permissions for the installer. Our SAP IT guys do the same, we select the update or software from a internal list and it runs under the Admin account. They should be able to do the same.

For example is McAffee is installed under admin rights and even though we have some admin permissions we can't modify that install, it just runs under the admin account.

0 Kudos

Hi Don,

Thanks for the link!

We sat down with someone from IT who has domain level access. Even he isn't able to run without admin; I have lower permission level and runs fine for me. We tried everything within the link you sent + more.

I apologize for all the questions- this has everyone stumped.

It's definitely something with the Crystal .NET libraries. If I comment out the DIM statements where the classes are instantiated, the program will launch. Is there something with the libraries that could tie the program to my user account?

0 Kudos

Not just those need permissions you also need Admin rights to the registry, lots of COM dll's and GUID's need to be accessed on startup/load.

See if this helps:

https://answers.microsoft.com/en-us/windows/forum/all/windows-10-grant-a-specific-application-perman...

I have the same problem here, SAP doesn't allow a lot of software to simply run.

To start Visual Studio I had to do the above, Select Run as Admin, to be able to fully create/edit my test app's.

Even have to do this for Notepad, if I don't run as Admin I can't save to anywhere on my local HD, always goes into my USER folder structure.

It's the nature of Windows Security, they have to be granted permission to run the app.

It may be your AV software is blocking it also, check those settings and add your EXE to the trusted list.

0 Kudos

Good morning,

We gave the Crystal Reports folder (and sub folders) read/write access for all.

Also gave the \windows\temp folder read/write for all (separate suggestion).

The program is also installed for all.

Still getting the Admin requirement after install.

0 Kudos

You'll have to discuss with your IT guys, there my be the User Accounts have restricted permissions.

Could be your AV software need crw32.exe added to the trusted list also.

As noted, when installing you should have an option to Allow All users, make sure that is allowed.

0 Kudos

Thanks, Don.

My apologizes, I wasn't clear on when it requires admin.

It's after the program has been installed.

When the user goes to open the installed program, it crashes with the Crystal error.

If the user right clicks the installed program and runs as admin, it runs fine.

0 Kudos

Hi Jeremy,

CR for VS requires Admin rights when installing due to permissions for the Framework and other resources it needs, not all for CR but Windows security as well. Also required so the installer cna register various COM dll's into the Registry.

So when installing your app and CR MSI packages you will need Admin rights, and select the option for All Users when installing.

No way around this, it's all due to security.

A possible solution is to right click on your App Icon and select the option to Run As Administrator, Users will get the UAC pop up. Talk to your IT guys, they can add an exception to allow your app to run with UAC popping up.

Don