Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

[PLAIN][Resolved]Binary Reader. Resource Object.[/PLAIN]

 

I have an embedded .config resource file "IncidentTrackerDockTemplate.config" in my Resource File called "GlobalResource".

I would like to read this file using BinaryReader. i get an exception in my code.

Value cannot be null.

Parameter name: input

 

below is the code. Any one knows where the problem is?

[color=Blue]private[/color] System.Resources.[color=ff2b91af]ResourceManager[/color] resources = [color=Blue]new[/color] System.Resources.[color=ff2b91af]ResourceManager[/color]([color=red]"Incidents_Tracker.UI.GlobalResource"[/color], System.Reflection.[color=ff2b91af]Assembly[/color].GetExecutingAssembly());
[color=ff2b91af]BinaryReader[/color] sr = [color=Blue]new[/color] [color=ff2b91af]BinaryReader[/color]([color=ff2b91af]Assembly[/color].GetExecutingAssembly().GetManifestResourceStream(resources.GetObject([color=red]"IncidentTrackerDockTemplate"[/color]).ToString()), System.Text.[color=ff2b91af]Encoding[/color].GetEncoding([color=ffa31515]"UTF-16"[/color]));[color=Green]
[/color]

Edited by skea

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...