In .NET, there are two categories of types, reference types and value types.
Structs are value types and classes are reference types.
The general difference is that a reference type lives on the heap, and a value type lives inline, that is, wherever it is your variable or field is defined.
A variable containing a value type contains the entire value type value. For a struct, that means that the variable contains the entire struct, with all its fields.
A variable containing a reference type contains a pointer, or a reference to somewhere else in memory where the actual value resides.
This has one benefit, to begin with:
- value types always contains a value
- reference types can contain a null-reference, meaning that they don't refer to anything at all at the moment
Internally, reference types are implemented as pointers, and knowing that, and knowing how variable assignment works, there are other behavioral patterns:
- copying the contents of a value type variable into another variable, copies the entire contents into the new variable, making the two distinct. In other words, after the copy, changes to one won't affect the other
- copying the contents of a reference type variable into another variable, copies the reference, which means you now have two references to the same somewhere else storage of the actual data. In other words, after the copy, changing the data in one reference will appear to affect the other as well, but only because you're really just looking at the same data both places
When you declare variables or fields, here's how the two types differ:
- variable: value type lives on the stack, reference type lives on the stack as a pointer to somewhere in heap memory where the actual memory lives (though note Eric Lipperts article series: The Stack Is An Implementation Detail.)
- class/struct-field: value type lives completely inside the type, reference type lives inside the type as a pointer to somewhere in heap memory where the actual memory lives.
Okay, so you're running the installer that is updating your XPE development environment, right? Or are you attempting to run that on a device before you seal it?
You need to run that installer on the workstation that has the XPE dev environment (and database) installed. The installer is looking for a specific database on a specific instance of Sql Server, so if you have (or somebody else has) changed it, you'll need to read up on how to specify the connection string to use with the installer.
In addition, it's probably trying to connect using your windows account credentials. Make sure you are able to log on to Sql Server, open the DB with the component definitions, and add records to it. Alternatively, if you can specify the connection string you can set a Sql login username and password to use.
Profiler is a great tool for troubleshooting the two issues described above.
Once you have the components installed, you'll have to add them to your image, check your dependencies and then build it.
If you're trying to just install .NET 2.0 on a machine directly (before you reseal it), you will need the packages for Windows Installer on the machine first. There might be some other dependencies; I haven't done it in a long time so I can't remember.
The best way to troubleshoot dependencies on an XPE installation is to put ProcessMonitor from Sysinternals on it. As you run the installer, you'll see where it attempts to find stuff and fails. Take that information back to your XPE IDE and search your components for those files. You then have to add the packages containing those files to your image and try again. Its an arduous process sometimes..,.
Best Answer
If you try to install NetFx20SP2_x86.exe on a x64 system you will get the following error message:
If you have already installed the .NET x64 runtime, you actually get both x64 and x86 versions. The one that will be used depends on which platform the assembly is compiled against (the /platform compiler switch). For AnyCPU, it will use x64 otherwise, it will use whatever was specified.