You are not allowed to just read files from disk in Silverlight (imagine what malicious hackers would use that for in their silverlight apps).You must use an OpenFileDialog and have the user pick the file for you.It doesn't matter if it's in the clientbin folder. Remember that Silverlight runs on the 'client' and not on the webserver where the clientbin file resides.
Try this if this helpshttp://esrislcontrib.codeplex.com/
List<FileInfo> shapes = new List<FileInfo>(); FileInfo runwayShp = new FileInfo("Layers\\Runway.shp"); FileInfo runwayDbf = new FileInfo("Layers\\Runway.dbf"); shapes.Add(runwayShp); shapes.Add(runwayDbf);
System.Security.SecurityException was unhandled by user code Message=File operation not permitted. Access to path 'Layers\Runway.shp' is denied. StackTrace: at System.IO.FileSecurityState.EnsureState() at System.IO.FileInfo.Init(String fileName, Boolean checkHost) at System.IO.FileInfo..ctor(String fileName) at MidwayAirportApplication.MainPage.LoadShapeFiles() at MidwayAirportApplication.MainPage..ctor() at MidwayAirportApplication.App.Application_Startup(Object sender, StartupEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName) InnerException:
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.