maybe its been a long day, but I just cant figure this out.

I retrieve a large custom object from WCF, and store it in an application variable.
This happens every 20 minutes.

For each web user, I am checking the existence and timeout of this application variable, and if needed, re-query my wcf and build a new object, and re-store it in the application variable.

**This all good and well.**

Now, I am trying to "make a copy" of this "master" object, modify it, and store it in a session variable, modifying it as needed throughout the session life cycle. (modifying the session variable).

Everytime I modify the session object, the object in the application variable gets modified.

**Pseudo**

```
application("mastervar") = object from wcf (obejct type - xcustomclass)

dim mynewobject as new xcustomclass
mynewobject = application("mastervar")

```

**\*** Modifying mynewobject, also modifies application("mastervar")

**I have tried:**

```
session("mynewSessionVar") = application("mastervar")
mynewobject = session("mynewSessionVar")

```

Modifying mynewobject, modifies application("mastervar")

**I have tried:**

Manually copying all properties in mastervar object to new object, with a for loop.

```
mycustomobject = new xcustomclass
mycustomobjectObject as new xcustomclass.object

mymasterobject = application("mastervar")

for each object in mymasterobject.objectslist
mycustomobjectObject = new xcustomclass.object

with mycustomobjectObject
  .property = object.property
end with

mycustomobject.objectlist.add(mycustomobjectObject)

next

```

Same thing, modifying mycustomobject, also modifies application("mastervar")

As I said, maybe its been a long day, but I've been bumping my head against this for hours...

### EDIT

```
 Private Function copy_fresh_units(unitsFromWcf As WebResortUnits) As WebResortUnits
        Dim myFreshUnits As New WebResortUnits
        Dim myFreshUnit As WebResortUnits.qbunit

        For Each Unit In unitsFromWcf.resortUnits
            myFreshUnit = New WebResortUnits.qbunit

            With myFreshUnit

                ' .Availability = Unit.Availability
                .mapDetails = Unit.mapDetails

            End With

          myFreshUnits.resortUnits.Add(Unit)

         Next

return myFreshUnits

End Function

```

Modifying the availability property in myfreshUnits, it still updates the app var. I have had a look at reference and value types, and it is definitely my issue. But taking this alst edit into account, I know I am missing something, what it is, I am not sure... :-)