C# – Website –> Add Reference also creates files with pdb extensions

asp.netassembliescnet

Q1
Any assemblies stored in Bin directory will automatically be referenced by web application. We can add assembly reference via Website –> Add Reference or simply by copying dll into Bin folder. But I noticed that when we add reference via Website –> Add Reference, that additional files with .pdb extension are placed inside Bin. If these files are also needed, then why does reference still work even if we only place referenced dll into Bin, but not pdb files

Q2
It appears that if you add a new item to web project, this class will automatically be added to project list and we can reference it from all pages in this project.

So are all files added to project list automatically being referenced ?

thanx

EDIT:

On your second question, you are adding a public class to a namespace so will be visible to other classes in that project and in that namespace.

I don’t know much about assemblies, but I’d assume the reason why item( class ) added to the project is visible to other classes in that project is for the simple fact that in web project all classes get compiled into single assembly and for the fact that public classes contained in the same assembly are always visible to each other?

much appreciated

Best Answer

  1. PDB is used to give you line numbers in stack trace. It's always optional
  2. No. You need to specifically reference from each project.