Saturday, December 19, 2009

How does Visual Studio include Referenced Libraries?

A problem was raised on the forums a number of times about World Wind building in Release mode.

If you checked out the source from SVN, and opened the project in Visual Studio, then tried to build in release mode you would receive errors such as:


C:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Tao.OpenGl.Glu". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

C:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "ICSharpCode.SharpZipLib". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

C:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Tao.OpenGl.ExtensionLoader". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

C:\Apache2\htdocs\html\WWsrc\PluginSDK\T iledWFSPlacenameSet.cs(10,7): error CS0246: The type or namespace name 'ICSharpCode' could not be found (are you missing a using directive or an assembly reference?)


Answer given by forum member, James_in_Utah:

I think the problem is that those DLLs may not be checked in for the "Release" mode build. Try building in Debug mode. That should work. Then find the dlls mentioned, Tao.OpenGl.Glu.dll, ICSharpCode.SharpZipLib.dll in the Debug target directory and just copy them to the Release mode target directory. We really probably should check these into the release mode build target directory in SVN, but I don't have privs to do that.


I added these two .dlls to the Release folder in World Wind SVN and commited the changes.

This brought the question to my mind, this seems to be a bad practice to check in to source control the contents of the output directory. I see that the .dlls are referenced under project references. Shouldn't there be a way that on build it copies the required .dlls to the Release folder or Debug folder as necessary?.

Unfortunately no one on the forum seemed to have a response and a quick web search revealed no answers.

No comments:

Post a Comment