Sunday, May 23, 2010

Visual Studio - Search order for assemblies

Search order for assemblies when building a project of a solution in Visual Studio:

* Files from the current project indicated by {CandidateAssemblyFiles}.
* $(ReferencePath) property that comes from .user/targets file.
* $(HintPath) indicated by reference item.
* Target framework directory.
* Directories found in registry that uses AssemblyFoldersEx Registration.
* Registered assembly folders, indicated by {AssemblyFolders}.
* $(OutputPath) or $(OutDir)
* GAC

If the desired assembly is found by HintPath, but an alternate assembly can be found using ReferencePath, it will prefer the ReferencePath to the HintPath one.
Share/Bookmark

Visual Studio - Specify assemblies location by registry key

- Open registry by Regedit
- Search for following key (Depend on VS version use the correct number to point to this key in registry):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\AssemblyFolders]
- Set the value of the key [AssemblyFolders] of type REG_SZ to the path of your assemblies.
Share/Bookmark

Saturday, May 22, 2010

to specify where Visual Studio search for the assemblies which you reference in your project

Unfortunately Visual Studio doesn't allow you to edit to reference assemblies, then you need to open the project file by a text editor and directly edit the ta and save the project file. When Visual studio detects the file change, it will ask you to reload the file.

Example:
<Reference Include="YourAssembly.dll">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\CommonAssemblies\YourAssembly.dll</HintPath>
</Reference>

Share/Bookmark

Sunday, May 9, 2010

Rounding line T-SQL in .NET


Share/Bookmark

Tuesday, May 4, 2010

T-SQL Object types in sysobjects (xtype column)


Share/Bookmark