|
-
Jul 18th, 2012, 04:55 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Overload resolution failed because no accessible 'New' can be called without a narrow
Im working on a really old site and the following line is causing an error
Code:
Dim newFile As FileStream = New FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create, System.IO.FileShare.ReadWrite)
Any ideas how to correct this issue
-
Jul 18th, 2012, 09:25 AM
#2
Fanatic Member
Re: Overload resolution failed because no accessible 'New' can be called without a na
Not completely sure if it will help but worth a try (unfamiliar with vb.net)
Code:
Dim newFile As New FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create, System.IO.FileShare.ReadWrite)
-
Jul 18th, 2012, 09:55 AM
#3
Thread Starter
Fanatic Member
Re: Overload resolution failed because no accessible 'New' can be called without a na
exactly the same error, but thanks for trying. Unfortuantely I never properly learnt any programming so have no idea about the diffeerence between new and = etc
-
Jul 18th, 2012, 10:24 AM
#4
Thread Starter
Fanatic Member
Re: Overload resolution failed because no accessible 'New' can be called without a na
sorted, i changed too
Code:
Dim filepath As String = (Server.MapPath(sSavePath & sFilename))
Dim newFile As FileStream
newFile = New FileStream(filepath, FileMode.Append)
-
Jul 19th, 2012, 01:11 AM
#5
Re: [RESOLVED] Overload resolution failed because no accessible 'New' can be called w
Out of interest, what was the exception that you were seeing?
Gary
-
Jul 19th, 2012, 03:30 AM
#6
Thread Starter
Fanatic Member
Re: [RESOLVED] Overload resolution failed because no accessible 'New' can be called w
Overload resolution failed because no accessible 'New' can be called without a narrow
-
Jul 19th, 2012, 08:45 AM
#7
Fanatic Member
Re: [RESOLVED] Overload resolution failed because no accessible 'New' can be called w
Although error message is partially posted here, I assumed it was "Overload resolution failed because no accessible '<method>' can be called without a narrowing conversion: <error>:"
Got the reference at MSDN: http://msdn.microsoft.com/en-us/libr...(v=VS.90).aspx
Since I do not know VB much, I am not sure if assigning a new instance varies on where it is done. I also miss out on "+" and "&" for string concatenation (I thought they were same).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|