- Home /
Problem with FileStream
Hi, I have a problem with FileStream in Unity. All the constructor are not recognize.
This one is not: new FileStream(SafeFileHandle, FileAccess, Int32, Boolean)
Assets/ResourceScript/PipeServer.cs(240,99): error CS1502: The best overloaded method match for
System.IO.FileStream.FileStream(System.IntPtr, System.IO.FileAccess, bool, int)' has some invalid arguments > Assets/ResourceScript/PipeServer.cs(240,99): error CS1503: Argument
#1' cannot convertMicrosoft.Win32.SafeHandles.SafeFileHandle' expression to type
System.IntPtr'
I have a warning with: new FileStream(IntPtr, FileAccess, Boolean, Int32)
Assets/ResourceScript/PipeServer.cs(238,120): warning CS0618:
System.IO.FileStream.FileStream(System.IntPtr, System.IO.FileAccess, bool, int)' is obsolete:
Use FileStream(SafeFileHandle handle, FileAccess access, int bufferSize) instead'
It works for a time and then I'm disconnected.
Is somebody already use FileStream with SafeFileHandle in a MonoBehaviour ?
Thanks. Harold
Answer by luizgpa · Jan 05, 2012 at 06:59 PM
According to the .Net/Mono Compatibility page the constructor you want is not avaliable using the .NET 2.0 subset, which is the default option. To change it go to Edit -> Project settings -> Player -> Other settings -> Api compatibility level.
Your answer
Follow this Question
Related Questions
Add to .net Arrays 1 Answer
text to speech in webplayer 0 Answers
Finding all USES of a class or function .... at runtime. 3 Answers
Type or namespace not found 1 Answer
SpeechRecognitionEngine.InstalledRecognizers() returns null within Unity. 3 Answers