Showing posts with label assembly. Show all posts
Showing posts with label assembly. Show all posts

Friday, April 18, 2014

How to disable generating .PDB files while compiling .NET assembly/ website in Release mode

While compiling your .NET assembly or publishing ASP.NET or MVC project in Release mode, you may observe .pdb file also gets generated along with necessary .dll or supporting files.
PDB file contains debugging information and symbol which does not make any sense during deployment or release of a product.
In order to get rid of generating PDB files during publish/ build -
1. Open the project properties of a project in Visual Studio
2. Click on "Build" tab
3. Make sure the configuration selected is "Release"
4. Click on "Advanced" button
5. Select "none" in "Debug Info" selection box.
6. Click OK, and save the project
Try building the project, and you will not see PDB files.

Screenshots:



Friday, December 7, 2012

Investigations:Could not load file or assembly or one of its dependencies.An attempt was made to load a program with an incorrect format.

ERROR: Could not load file or assembly or one of its dependencies.An attempt was made to load a program with an incorrect format. 

Developers generally face this issue in production server, or running a web application under IIS.
The site works fine in the integrated development environment, but fails and giving this error while running it in IIS.
The most likely reason of this issue is the incompatibility of target platforms. 
Say, your  application is targettng to only x32, but the dependent assembly targets to "Any CPU", or vice versa.

In order to fix this issue, you need to change settings of relevant Application Pool in IIS, to allow 32-bit applications.



This should resolve the issue.