Could not find assembly version
Hello,
Before I start I should say I'm a .Net novice so bear with me here. And please be as basic as you can in your response :)
I'm trying to run one of the sample VB.Net solutions that is provided with the latest SQL Server 2005 CTP. When I attempt to build it I get the following error:
"Namespace or type specified in the project-level Imports 'System.Data' cannot be found. Make sure the namespace or type is defined and it doesn't contain other aliases"
Also the following warnings:
"Could not resolve this reference. Could not locate the assembly "System, Version=2.0.3600.0, Culture-neutral, PublicKeyToken=b77a5c561934e089". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors."
"The referenced component 'System' could not be found"
I also get the same warnings for 'System.XML', 'System.Data' & 'System.Deployment'
I've looked in C:\WINDOWS\assembly and v2.0.0.0 of all these assemblies are in there.
Why doesn't this work?
Why is my solution specifically looking for version 2.0.3600.0 of these assemblies? I don't know much about this stuff but I thought a solution would be version agnostic.
Note that Visual Studio doesn't seem to have a problem with these namespaces in the IDE. The "Imports" statement for all of them isn't erroring.
Any suggestions much appreciated!
-Jamie
Hi,
The version that those samples are referring to are Beta1 of .NET Framework 2.0.
The version number for Beta 2 of .NET v2.0 is 2.0.50215
There have been a number of changes between Beta 1 and Beta2, so it may not be possible for you to run those samples using Beta 2.
In any case, you can try to remove the references to those DLLs which you have named from the solution and then add them from the References Box and try building the solution.
Regards,
Vikram
Thank you Vikram.
The samples I was using were indeed provided with a version of SQL Server 2005 that used VS beta1. I have installed the samples provided with the latest CTP and they build OK.
To satisfy my curiosity though...
My assumption was that a .Net solution does not care which version of the .Net Framework it is using. Obviously that is wrong.
I now assume therefore that somewhere in my solution is stored the version of the framework that the solution will work with. Is this correct?
Regards
Jamie
Hi Jamie,
The details are actually stored in the Project file which has a .csproj or a .vbproj extension. The solution file will usually consist of multiple project files. There is a Reference XML tag in the project file which can include information specific to a version.
A normal reference tag would look as follows:
<Reference Include="System" />
In this case, its not dependent on version.
However, it can also be detailed as shown below binding it to a specific version:
<Reference Include="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<SpecificVersion>True</SpecificVersion>
<HintPath>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll</HintPath>
</Reference>
Depending on that, there can be an affinity between the Project File and the version of the .NET Framework.
Regards,
Vikram