Question

I am porting a Windows CE / CF solution (an exe and a class library/DLL) from Visual Studio 2003 / .NET 1.1 to Visual Studio 2008 / .NET 3.5

The final line of code here:

private bool ConnectToServer( ref Util.thisEnv tEnv )
{
bool bRet = false;

Util.CloseAll();
do
{
    Thread.Sleep( 100 );
} while( Util.dW_Running );

try
{
    tEnv.siteNumber      = siteNumber;
    tEnv.opFlag          = 0;
    tEnv.pptStream       = null;

...is throwing a compile-time error, namely:

The type 'System.Net.Sockets.NetworkStream' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.0.0

But I am referencing that version of the System assembly in this project.

Both Runtime Version and Version are 2.0.0.0 Path is C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\System.dll

The other project (the class library/DLL) references System, too, with a slight difference in that Runtime Version is v2.0.50727 and the Path is C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll

Could this mismatch of System assemblies between the "cousing" projects be the source of this problem? It wouldn't seem so, but I don't know why this seemingly fallacious error is cropping up...???

Was it helpful?

Solution

That's more than a "slight" difference. One reference is a Compact Framework reference, the other is a desktop reference. The reference to "C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll" must be removed, or it will attempt to push the full framework to your device and it won't run anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top