Deploying log4net with a Click Once deployment


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 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?


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
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.
dorothy60Author Commented:
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,

Jacques Bourgeois (James Burger)PresidentCommented:
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.
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

dorothy60Author Commented:
Hi, JamesBurger,

Thank you for your thoughts on CR alternatives. I am trying to start a small work at home business for myself selling Bird Tracker, a program that I have written for people who share their lives with companion birds. I started it months ago on a laptop with Visual Studio 2010 and Windows 7. The laptop started having some issues, and I happened to come into a little money, so about a month ago I bought a HP desktop, which came with Windows 8, and that is when the complications started. I had some issues with VS 2010, so I got VS 2012. On the old computer, I had few problems deploying Bird Tracker, which uses CR. When I upgraded to VS 2012, I had to upgrade CR.

When I was working as a Software Engineer, before the company bought reporting software, I was using Word via OLE to generate reports.

Bird Tracker is for the common computer user who does not have office, much less SQL Server. It uses SQL Server Compact Edition.

I did get my CR test to install and work on my test computer last night! I went to Application Files in VS and changed log4net.dll and stdole.dll from "Prerequisite (Auto)" to "Required", published it, and had no problems!

I will check out ActiveReports and Infragistics!



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jacques Bourgeois (James Burger)PresidentCommented:
Telling you that something cannot be done is a valid answer.
dorothy60Author Commented:
Telling me that what I was trying do to could not be done was simply wrong. How is that a valid answer?

Jacques Bourgeois (James Burger)PresidentCommented:
If you found a solution, at least post it, so that other programmers can benefit from it.
dorothy60Author Commented:
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!

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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.