0

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...???

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

1 Answers1

1

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.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • Okay, I replaced the desktop reference with the same System reference (CF) as the other. Both of the projects accept version 2.0 of System being added, but not version 3.5. Does this mean I'm using CF 2.0 instead of 3.5? If so, why is version 3.5 being barred? – B. Clay Shannon-B. Crow Raven Oct 01 '13 at 22:42
  • No, CF 3.5 uses the CLR version 2.0, just like on the desktop. – ctacke Oct 02 '13 at 00:20