ppirtle
2008-02-15, 07:14 PM
Once again, I'm learning Visual Studio 2008 at the same time as I'm playing with the Revit API. I'm following the labs from AU2007, but seem to be struggling. What I'm trying to do today is simply to write to a text file. Here's my code:
'I've imported System and System.IO
Try
Dim fileName As StreamWriter = New StreamWriter("C:\temp\test2.txt")
Catch ex As Exception
MsgBox("Can't open file: " & ex.Message)
End Try
I get the message box as follows:
"Can't open file. Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
When I try this outside of Revit in a Windows Forms app, it works just fine.
TIA for any help and suggestions.
'I've imported System and System.IO
Try
Dim fileName As StreamWriter = New StreamWriter("C:\temp\test2.txt")
Catch ex As Exception
MsgBox("Can't open file: " & ex.Message)
End Try
I get the message box as follows:
"Can't open file. Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
When I try this outside of Revit in a Windows Forms app, it works just fine.
TIA for any help and suggestions.