Link to home
Start Free TrialLog in
Avatar of dorothy60
dorothy60Flag for United States of America

asked on

Deploying log4net with a Click Once deployment

Hello,


I am trying to deploy a test application that just consists of a form that has a Crystal Report that has one text field that says "Hello World". I am using the latest version of Crystal Reports for Visual Studio. The program works perfectly in the IDE, the problem comes when I try to publish it for Click Once deployment. In the Prerequisites, I select Windows Installer 4.5 (I have tried with and without this, makes no difference), .NET Framework 4.5 and the required prerequisite for Crystal Reports. When I run Setup in the test environment, when it tries to install Crystal Reports, I get a message, "Unable to install or run the application. The application requires that assembly log4net Version 1.2.10.0 be installed in the Global Assembly Cache (GAC) first".

In my research, I have seen that there is some utility to install log4net in the GAC, but what I learn here will be applied to the application I am writing to sell, and I cannot have the users run some utility to install log4net in the GAC.

How can I have setup.exe install log4net in the GAC?


Thanks,

Dotty
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Crystal report has been a pain to install on client station since it appeared somewhere in the 90's.

Sorry for you, but you cannot install anything in the GAC through ClickOnce. It's one of the limitations of ClickOnce. It's part of its design. its aim is to simplify application updates by a standard user. So no provision has been done to using it as an administrator. And no matter what type of installations you chose, the GAC requires the user to run the installation as an administrator.

You have to either install it with the utility you found prior to deploying through ClickOnce, or change your installation scheme, possibly as an msi file, that offers the possibility of installing in the GAC.
Avatar of dorothy60

ASKER

Hi, JamesBurger,

I am using the free version of CR. Are there any other reporting tools out there that are free and easier to deploy? I am not doing any charting or graphing or anything. I am just pulling data from datasets.


Thank you,


Dotty
There are many options I know, maybe other experts will jump in to provide other alternatives.

I meet a lot of programmers in my training sessions. Many of them use ActiveReports (sorry, I do not have the link, you will have to search a bit). Most of them have tried Crystal Report before (after all, the basic version comes free), and did not like it. But they like ActiveReports. A few gave good words about a report generator provided by Infragistics. I am not aware however of free versions for these.

If you think you will be eventually be using SQL Server as a database, it has a built-in report generator, that can be used through a report control in a .NET application. I have not used it personnally, but what I hear is that although it offers less possibilities than Crystal, it does the job for most reports. And its free... once you have SQL Server. The fact that the reports are part of the database is also an interesting option.

Personnally, most my customers were on Microsoft Access before they switched to something else. So I often used it as a report generator. Access is able to connect to almost any database throught ODBC, and many users know how to create their own reports in Access, so they like being able to add their own reports over the ones I design for them.

Strange for a programmer, but some of the best and most complex reports I did where done using Microsoft Word as a report generator. Because I write a lot of training material, I came to be a Word power user (you need to be in order to use it as a report generator). It requires a bit of code instead of dragging, dropping and set properties, but not that much if you know about styles, sections and templates. Nothing ever offered me as much features and control as Word as a report generator.

Many programmers I know are more at ease with Excel than with Word. And they use Excel as a report generator. If you know how to link Excel to an external data source and how to create reports in Excel, it requires very little code.

In order to use Access, Word or Excel, your users must however already have these installed on their computer, which is not the case with more standard reports generators such as Crystal, ActiveReports and Infragistics.
ASKER CERTIFIED SOLUTION
Avatar of dorothy60
dorothy60
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Telling you that something cannot be done is a valid answer.
Telling me that what I was trying do to could not be done was simply wrong. How is that a valid answer?

Dotty
If you found a solution, at least post it, so that other programmers can benefit from it.
I solved this problem by going  to "Application Files" in VS and changed log4net.dll and stdole.dll from "Prerequisite (Auto)" to "Required", published it, and had no problems!


Dorothy60
I was told that I could not get around this problem. I found a way to eliminate it!


Dotty