Today i was working on console application which is generating automatic notices using .rdlc file. I was adding barcode into each page of dynamic generated N number of pages. which i have decided to accomplish by referencing external assembly which has one function from where i can pass the parameter and it's give me barcode in terms of bytes. but while adding that assembly i got following error.
"Error while loading code module: ‘Neodynamic.SDK.Barcode, Version=4.0.2000.0, Culture=neutral, PublicKeyToken=c6b33c3093a0d4cd’. Details: Could not load file or assembly 'Neodynamic.SDK.Barcode, Version=4.0.2000.0, Culture=neutral, PublicKeyToken=c6b33c3093a0d4cd' or one of its dependencies. The system cannot find the file specified. "
There are lots of options to solve on internet like adding into "private assemblies" folder of visual studio program files, or add localreport.AddTrustedCodeModuleInCurrentAppDomain etc....
but nothing works. finally i got the solution and it's very simple.
To solve, just do following:
Step 1. Add your external assembly into bin directory of your application, in my case, i am using console application so i moved there.
Step 2. Right click on your "xyz.rdlc" file and click on properties and change "Build Action: None" and "Copy to Output Directory: Do not copy".
That's it.
You can run the application and it will generate report smoothly.
some of the screen shots which i would like to share, so you can see and understand it visually as well.
The .NET Framework and ASP.NET help you create web applications and services for Windows.
Subscribe to:
Post Comments (Atom)
React-select is very slow on larger list - Found solution - using react-window
I had more than 4000 items in searchable dropdownlist. I have used react-select but it was very slow. finally I found complete solution to ...
-
Today I will show you how to use new salesforce toolkit for .NET Application. Follows the steps: Step 1. Create a project with C# ASP.NET ...
-
Classic mode is a mode where IIS only works with ISAPI extensions and ISAPI filters directly. In fact, in this mode, ASP.NET is just an ISA...
Good morning,
ReplyDeleteIn my case, I couldn't change the rdlc's "Build Action=Embedded Resource" because we customized the loading process:
reportAssembly = Assembly.Load(reportAssemblyName);
var templateStream = reportAssembly.GetManifestResourceStream(reportTemplatePath);
But, we manage to make it work by setting rdlc's "Copy to Output Directory=Copy if newer".
I hope it's a good way to do things and it can help!
Davy