473,789 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem reading resource stream in ASP.Net

I'm having a problem reading a resource stream using the following syntax:

Dim resStream As System.IO.TextR eader = New _

System.IO.Strea mReader(Me.GetT ype.Assembly.Ge tManifestResour ceStream("mynam e
space.script.js "))

I receive the error: Value cannot be null. Parameter name: stream

I think the underlying problem is that the name of the assembly
(Assembly.FullN ame) appears to be some kind of temporary name at run time.
For example, this is what Assembly.FullNa me looks like at runtime:
"si2y4pl3, Version=0.0.0.0 , Culture=neutral ,
PublicKeyToken= null" String

The code is in an assembly which contains a base class I've written for
ASP.NET pages (class inherits from System.Web.UI.P age). I reference this
assembly in a web project and aspx pages inherit from the base class I
created.
Brad
Nov 21 '05 #1
1 3614
Found the problem.
Changed from

System.IO.Strea mReader(Me.GetT ype.Assembly.Ge tManifestResour ceStream("mynam e
space.script.js "))
to
Dim asm As [Assembly] = [Assembly].GetExecutingAs sembly()
New
System.IO.Strea mReader(asm.Get ManifestResourc eStream(asm.Get Name.Name &
".script.js "))

"Brad" <no****@co.lane .or.us> wrote in message
news:e1******** ******@TK2MSFTN GP12.phx.gbl...
I'm having a problem reading a resource stream using the following syntax:

Dim resStream As System.IO.TextR eader = New _

System.IO.Strea mReader(Me.GetT ype.Assembly.Ge tManifestResour ceStream("mynam e space.script.js "))

I receive the error: Value cannot be null. Parameter name: stream

I think the underlying problem is that the name of the assembly
(Assembly.FullN ame) appears to be some kind of temporary name at run time.
For example, this is what Assembly.FullNa me looks like at runtime:
"si2y4pl3, Version=0.0.0.0 , Culture=neutral ,
PublicKeyToken= null" String

The code is in an assembly which contains a base class I've written for
ASP.NET pages (class inherits from System.Web.UI.P age). I reference this
assembly in a web project and aspx pages inherit from the base class I
created.
Brad

Nov 21 '05 #2

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

Similar topics

2
3026
by: Dariusz | last post by:
Below is part of a code I have for a database. While the database table is created correctly (if it doesn't exist), and data is input correctly into the database when executed, I have a problem when reading out the data into the PHP variables / array. It should be displaying the information out in the following way, using the PHP array: n_date, n_headline, n_summarytext, n_fulltext
1
2765
by: Boris Wilhelms | last post by:
Hello all, at first, sorry for my bad English, I’ll give my best  We have a strange problem reading Text- and VarChar-Fields. Our configuration: -Windows 2003 Server -MySQL Server 3.23.36 -MyODBC 3.51
0
1092
by: Thomas | last post by:
Hi, i get errors when reading a stream from httpwebrequest on a HP ipaq pocket pc. Framework 1.0 SP2 The same code runs sucessfully without errors on the 2003 pocket pc emulator and on windows xp. I have installed system.dr.dll to get the this detail error information, before i got "could not find resource assembly".
6
1781
by: The_Kingpin | last post by:
Hi again guys, I've decided to cut my project in section and I found it way easier like this. I'm having a little problem reading struct in a file though. I think after this I'll be able to handle it on my own. Right now the file is opened correctly and I'm able to read each line and print them in a new file. My problem is to insert each struct (which are made of 6 consecutive lines) as an item in my array.
3
2465
by: Alex Clark | last post by:
Hi All, I'm having some problems reading a network stream. I'm writing a lightweight POP client to handle a very specific task, but I keep unexpectedly reaching the end of the datastream when downloading a large-ish email (about 10K). This happens about 50% of the time when trying to download a large email from my POP server. I've tried telnet'ing into the POP server and manually issuing commands, and it works perfectly --- the...
0
1254
by: Manfred Braun | last post by:
Hi All, I have a problem reading queue-messages async. My QueueReader has a Start() and a Stop() method and if my app starts, it calls Start(). The problem is, that there are possibly several hundreds of messages in the queue, which I do not want to have processed by the async messagehandler at startup. So in Start(), I create a new thread, which's method just simply enums the queue-messages . At the end of this thread, I fire an...
7
10522
by: Jeronimo Bertran | last post by:
Hello , I am trying to read a resource in my .net app using a stream. I found the GetMainfestResourceStream but I am having trouble using it with the resources I edit with the resource editor. I added an icon named Devices.ico which I need to read as a stream.... I am able to load the resource using the ResourceManager as follows:
4
3222
by: andreas.fabri | last post by:
I have a problem reading integers separated by commas with VC8 This program: ___________________________ // read.C #include <iostream> int main()
8
3757
by: T Driver | last post by:
Anyone have any idea how I can do the following? I have a connection to an XML file on a site I do not control, getting a string representation of the xml data that I can then feed to my XmlDataSource object (CurrentXMLData): Stream newStream = myWebClient.OpenRead(myStringWebResource); TextReader newReader = new StreamReader(newStream); string newData = newReader.ReadToEnd(); CurrentXMLData.Data = newData;
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.