473,385 Members | 1,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

.net 1.1 to 2.0 - Filestream - error: Overload resolution failed because no accessible 'New' can be called without a narrowing conversion:

Since going to framework 2.0 from 1.1, I'm getting error:

Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:

On line:

Dim LogInfo As New FileStream("f:\xxx\xxx.log",
FileShare.ReadWrite,FileAccess.Read)

This code was working fine under 1.1

I tried taking the New out, but then I get:
Array bounds cannot appear in type specifiers.

I delete the log file and try again, but the errors persist.

Jul 17 '06 #1
2 1912
Hello ja***@cyberpine.com,

I think that the old code was doing an implicit conversion. This code probably
never shoudl have worked. The second parameter should be a FileMode enumeration,
and the fourth shuold have been the FileShare:

Dim LogInfo as New FileStream("f:\xxx\xxx.log", FileMode.Open, FileAccess.Read,
FileShare.ReadWrite)

Not sure (maybe a VB MVP can correct me), but in 1.1 FileShare.ReadWrite's
value is 3...the same as the FileMode.Open (which is 3). Make any sense?

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
Since going to framework 2.0 from 1.1, I'm getting error:

Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:

On line:

Dim LogInfo As New FileStream("f:\xxx\xxx.log",
FileShare.ReadWrite,FileAccess.Read)
This code was working fine under 1.1

I tried taking the New out, but then I get:
Array bounds cannot appear in type specifiers.
I delete the log file and try again, but the errors persist.

Jul 17 '06 #2
Yes. That fixes it. Thank you!

Shawn Wildermuth (C# MVP) wrote:
Hello ja***@cyberpine.com,

I think that the old code was doing an implicit conversion. This code probably
never shoudl have worked. The second parameter should be a FileMode enumeration,
and the fourth shuold have been the FileShare:

Dim LogInfo as New FileStream("f:\xxx\xxx.log", FileMode.Open, FileAccess.Read,
FileShare.ReadWrite)

Not sure (maybe a VB MVP can correct me), but in 1.1 FileShare.ReadWrite's
value is 3...the same as the FileMode.Open (which is 3). Make any sense?

Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
Since going to framework 2.0 from 1.1, I'm getting error:

Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:

On line:

Dim LogInfo As New FileStream("f:\xxx\xxx.log",
FileShare.ReadWrite,FileAccess.Read)
This code was working fine under 1.1

I tried taking the New out, but then I get:
Array bounds cannot appear in type specifiers.
I delete the log file and try again, but the errors persist.
Jul 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eph0nk | last post by:
Hi, I get an overload resolution failed error (Overload resolution failed because no accessible 'New' can be called without a narrowing conversion), and I can't seem to find a lot of relevant...
5
by: Gang Zhang | last post by:
Hi, I have 2 overloaded functions as below: myfunc(byval val as Decimal) as string myfunc(byval val as String) as string When calling the function with a single like: dim num1 as single...
1
by: steve | last post by:
I am trying to create an XSLT Transform but keep getting the same problem. Overload resolution failed because no accessible 'Transform' can be called with these arguments. I create a reference...
6
by: multisync | last post by:
I'm getting the following error: Overload resolution failed because no accessible 'Add' can be called with these arguments: 'Public Sub Add(item As System.Web.UI.WebControls.ListItem)': Value of...
0
by: tshad | last post by:
I am getting the following error which makes no sense. No accessible overloaded If you look at the error, there is one overloaded function that can be called (int, string, int, int). The...
13
by: Jim in Arizona | last post by:
I made a page with a gridview that has rows show a different color if a number in a column is greater than or equal to 45. I also did this conditional formatting for the column next to it. Here's...
1
by: mharbor | last post by:
Private Sub AddNode(ByRef inXmlNode As Xml.XmlNode, _ ByRef inTreeNode As TreeNode) Dim xNode As Xml.XmlNode Dim tNode As TreeNode Dim nodeList As...
24
by: Noah Roberts | last post by:
Item #1 in the More Exceptional C++ book uses the following construct: fstream in; .... process( in.is_open() ? in : cin,...); Where process has been shown as having various multiple...
0
by: ccante3070 | last post by:
What does this error message mean? program is vb.net 2003 Overload resolutionj failed because no accessible "Run" can be called with these arguments. 'Public Shared Sub Run (context As System....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.