Compiling MonoTouch Application to Device Fails - Works on Simulator
This week I ran into a problem that prevented the application I had written in MonoTouch from com-piling successfully to the iPhone/iPad device.
I outlined the problem more thoroughly on StackOverflow:
As you can see my question received a couple of answers, none of which worked out for me (though entirely valid).
So after more problem solving I worked out the solution below:
I changed the lines that read:
fs = new FileStream(fileName, FileMode.Open);
to:
fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
This fixed the problem because the default constructor asks for read/write access, which the applica-tions main bundle does not allow. Therefore, by specifying read-only access, the file stream does not ask the main bundle for write access which allows the file stream to read in the data. Simple when you know how, hope you found this helpful.
This is really nice, thank you for sharing....
ReplyDeleteIT Support Services
Hi,
ReplyDeleteYour site is looking very beautiful and so informative ,thanks.......
Software Development Company Odisha