H
Harry Simpson
I'm downloading a file from the web service folder on the server. Of course
it works great in my dev environment but deployed I keep getting the
following error:
ex.message = "could not find resource assembly"
I've narrowed it down to this bit of code but the error message doesn't make
sense in this context to me.....any ideas?
Which resource assembly could it be wanting and missing here????
TIA Much
************DA CODE SEGMENT*************************************************
Try
Dim wr As HttpWebRequest = CType(m_rec.Create(FullFilePath), HttpWebRequest)
Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)
Dim str As Stream = ws.GetResponseStream()
Dim inBuf(1000000) As Byte
Dim bytesToRead As Integer = CInt(inBuf.Length)
Dim bytesRead As Integer = 0
While bytesToRead > 0
Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead)
If n = 0 Then
Exit While
End If
bytesRead += n
bytesToRead -= n
End While
Dim fi As FileInfo
If File.Exists("\Application\" & strJustTheFileName) Then
fi = New FileInfo("\Application\" & strJustTheFileName)
fi.Attributes = FileAttributes.Normal
End If
Dim fstr As New FileStream("\Application\" & strJustTheFileName,
FileMode.Create)
fstr.Write(inBuf, 0, bytesRead)
str.Close()
fstr.Close()
inBuf = Nothing
fi.Attributes = FileAttributes.ReadOnly
Catch ex As Exception
MsgBox("Error in Download - Please try later. (" & ex.Message.ToString &
")", MsgBoxStyle.OKOnly, "Error in Download")
Exit Sub
End Try
Next
it works great in my dev environment but deployed I keep getting the
following error:
ex.message = "could not find resource assembly"
I've narrowed it down to this bit of code but the error message doesn't make
sense in this context to me.....any ideas?
Which resource assembly could it be wanting and missing here????
TIA Much
************DA CODE SEGMENT*************************************************
Try
Dim wr As HttpWebRequest = CType(m_rec.Create(FullFilePath), HttpWebRequest)
Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse)
Dim str As Stream = ws.GetResponseStream()
Dim inBuf(1000000) As Byte
Dim bytesToRead As Integer = CInt(inBuf.Length)
Dim bytesRead As Integer = 0
While bytesToRead > 0
Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead)
If n = 0 Then
Exit While
End If
bytesRead += n
bytesToRead -= n
End While
Dim fi As FileInfo
If File.Exists("\Application\" & strJustTheFileName) Then
fi = New FileInfo("\Application\" & strJustTheFileName)
fi.Attributes = FileAttributes.Normal
End If
Dim fstr As New FileStream("\Application\" & strJustTheFileName,
FileMode.Create)
fstr.Write(inBuf, 0, bytesRead)
str.Close()
fstr.Close()
inBuf = Nothing
fi.Attributes = FileAttributes.ReadOnly
Catch ex As Exception
MsgBox("Error in Download - Please try later. (" & ex.Message.ToString &
")", MsgBoxStyle.OKOnly, "Error in Download")
Exit Sub
End Try
Next