Select to view content in your preferred language

AccessViolation when setting layer.visible

823
2
11-22-2016 08:47 AM
JoshAxeen
Deactivated User

Using the Quartz 100 SDK (Release version) I am getting an AccessViolationException when trying to set the IsVisible value on a RasterLayer object. I checked the CanChangeVisibility property and it was true, but still throws the error when set. StackTrace was null.

Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

0 Kudos
2 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Please can you provide the code you wrote to reproduce this? If we're not able to repro with that code we may need the raster dataset you are using too, or a sample of it.

Cheers

Mike

0 Kudos
JoshAxeen
Deactivated User

Here is the section of code that loads the raster layer (Aerials) into the map. CurrentEsriMap is an the instance of EsriMap from your API that has been placed on window.

#region Load Aerials

var aerialLoader = new AerialMapPackageLoader();

// Construct the list of search paths.

aerialLoader.AddSearchPaths(this.GetSearchPaths(AERIALS_EXTENSION_FORMATTER));

IAerialMapPackage aerialPackage = await aerialLoader.SearchAndOpenAsync();

if (aerialPackage != null)

{

foreach (KeyValuePair

public bool IsVisible

{

get

{

return this.layer.IsVisible;

}

set

{

// This call is currently throwing an AccessViolationException intermittently with Quartz 100 Release version

// Forum: https://community.esri.com/thread/186308-accessviolation-when-setting-layervisible

this.layer.IsVisible = value;

}

}

I’m still waiting on a way to send you the 1.5 GB raster files yet.

Thanks,

Josh

0 Kudos