Christian,
Know it works, the Problem realy was the metadataObj of the Layer. After a
short time the Object was destroyed...the number of metadata in the Object were
OK but the programm were not able to find some specific metadata information,
so I get that error message.
I solved the problem by declaring the metadata-Object as a class-Member. So now
it works, but what could be the reason for that problem?
Yeah. After looking into the code i see that setting the metadata of
the layer is unsafe and to be avoided. I have posted a bug for it:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1803
Instead of creating a metadata object from scratch you should get the
reference of the HashTableObj of the layer by reading
layerObj.metadata a set the items as you have done before.
Another problem I've got is on closing the application. Not every but often I
get the following error:
System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication
that other memory is corrupt."
Source="mapscript_csharp"
StackTrace:
at mapscriptPINVOKE.delete_mapObj(HandleRef jarg1)
at mapObj.Dispose()
at mapObj.Finalize()
You should use the latest CVS version because you are using the
layerObj(mapObj) costructor. For more details see:
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1743
Best Regards,
Tamas