I’m need some guidance in the way to add references in Visual Studio 2010.
Method #1
Say, I created a ASP.NET 4 web site project.
At Solution Explorer, there’s a ‘Properties‘ button, I clicked on it.
The Property Pages appeared, the 1st option on the left is ‘References‘.
I clicked on ‘Add..’ and selected a few references, e.g. Microsoft.IdentityModel.
Then I clicked Ok.
Then I build the website, and lastly I published the website.
I view the folder where the published codes are located (still in the same computer), I don’t see Microsoft.IdentityModel.dll inside the bin folder.
Method #2
Say, I created a ASP.NET 4 web site project.
At Solution Explorer, I Add ASP.NET folder > bin
I right-clicked on bin folder, add an existing item, I navigate to the folder containing the Microsoft.IdentityModel.dll (C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\Microsoft.IdentityModel.dll)
Then I build the website, and lastly I published the website.
I view the folder where the published codes are located (still in the same computer), I see Microsoft.IdentityModel.dll inside the bin folder.
Assuming that later on I have some codes that uses that library file, so, what’s the significant differences from the 2 methods?
How will it affect when the web site is published to a server that do not have the Windows Identity Foundation runtime install?
With Method 1, you are adding a reference from the GAC. This means that the assembly can be resolved and loaded from the GAC and no need for it to be copied to the
binfolder.With Method 2, you are adding a reference directly to the dll. This will always cause an assembly to be copied to the
binfolder.