Difference between AppDomain.GetAssemblies and BuildManager.GetReferencedAssemblies

The .NET Framework defers loading assemblies into the current AppDomain until they’re needed. For example, if you call into a third-party library only from SomeMethod(), the third-party DLL normally won’t be loaded until the first time SomeMethod() runs. AppDomain.GetAssemblies() gives you all assemblies which have already been loaded into the current AppDomain. BuildManager.GetReferencedAssemblies() (This method … Read more

Visual Studio 2010: Reference Assemblies Targeting Higher Framework Version

Step1: Unload the referencing project targeting .NET 2.0 Step2: Right click the unloaded project and select edit from context menu Step3: Add <SpecificVersion>true</SpecificVersion> to the reference. Below is a sample from my repro solution: <ProjectReference Include=”..\HighFX\HighFX.csproj”> <Project>{8DD71CAF-BEF7-40ED-9DD0-25033CD8009D}</Project> <Name>HighFX</Name> <SpecificVersion>true</SpecificVersion> </ProjectReference> Step4: Reload the project. Now your should be able to build within the Visual Studio … Read more

Strange Error – CS0012: The type x is defined in an assembly that is not referenced

I’m Mike’s coworker, and we worked out a solution. The type X is defined in his assembly, that is only in the GAC. Even though his ASP.NET web appplication did have a reference, it was failing to load from the GAC only for this UserControl. The rest of the application worked as expected. We confirmed … Read more

C# assemblies, whats in an assembly?

Namespaces affect name resolution only. Namespaces do not imply any sort of storage, nor do namespaces determine which DLLs contain your code. Namespaces allow you to group related things together under a logical name even though they may physically reside in different DLLs. An assembly is basically just a DLL or EXE file. It contains … Read more

“Are you missing an assembly reference?” compile error – Visual Studio

In my case it was a project defined using Target Framework: “.NET Framework 4.0 Client Profile ” that tried to reference dll projects defined using Target Framework: “.NET Framework 4.0”. Once I changed the project settings to use Target Framework: “.NET Framework 4.0” everything was built nicely. Right Click the project->Properties->Application->Target Framework

Best practices for assembly naming and versioning?

Some good information from this article on Suzanne Cook’s blog on MSDN (posted 2003-05-30): When to Change File/Assembly Versions First of all, file versions and assembly versions need not coincide with each other. I recommend that file versions change with each build. But, don’t change assembly versions with each build just so that you can … Read more

How to save DLLs in a different folder when compiling in Visual Studio?

There are 2 parts of your question: How to configure solutions to build assemblies/EXE into folders of your choice – this is configured through properties of the project in VS (project properties -> build -> output path). Also value of check “copy local” property on each reference. How to load assemblies files from non-default locations … Read more

What is a mixed mode assembly?

http://msdn.microsoft.com/en-us/library/x0w2664k.aspx 1) Allways check msdn first. Mixed mode means that the assembly can run managed and unmanaged code. 2) Setups for 32-bit Windows (.NET Framework 4.0) http://system.data.sqlite.org/sqlite-netFx40-setup-bundle-x86-2010-1.0.74.0.exe You kinda answered that question yourself “My project that is going to use this library is all .NET 4 which will be compiled to x86.”

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)