The Artima Developer Community
Sponsored Link

C# Answers Forum
Problem with assembly for a sample app

2 replies on 1 page. Most recent reply: Apr 4, 2003 6:02 PM by Richard Muller

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Richard Muller

Posts: 10
Nickname: rlmuller
Registered: Mar, 2003

Problem with assembly for a sample app Posted: Apr 2, 2003 12:04 PM
Reply to this message Reply
Advertisement
I got the following error message after building/running a sample TreeView C# example:

mscorlib.dll

Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "TreeViewCtl.resources" was correctly embedded or linked into assembly "TreeViewDemo".
baseName: TreeViewCtl locationInfo: TreeViewCtl resource file name: TreeViewCtl.resources assembly: TreeViewDemo, Version=1.0.1186.28592, Culture=neutral, PublicKeyToken=null

Offending line #422:
imageList2.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList2.ImageSt ream");


The problem is no doubt caused by the way I cobbled together the example from the three .cs files (listed below) obtained from http://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/winforms/Samples/ControlReference/TreeViewCtl/TreeViewCtl.src&file=CS\TreeViewCtl.cs&font=3

Because I didn't know how to create an assembly to go along witht the sample .cs files, I started by creating a new WindowsApplication project "TreeViewDemo".

I then built three new text files in the TreeViewDemo folder,
DirectoryNode.cs
PlatformInvokeKernel32.cs
TreeViewCtl.cs

and copied/pasted the code from the Web into them.

Finally, using Solution Explorer, I deleted the generated Form1.cs and then added the three .cs files just mentioned.

The project compiled cleanly, but hung with the error diagnostic indicated above. Any suggestions on how to resolve this would be greatly appreciated.


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Problem with assembly for a sample app Posted: Apr 2, 2003 7:42 PM
Reply to this message Reply
In your post, there seems to be a spurious space in "imageList2.ImageSt ream" -- maybe that is the cause (or was that just an effect of posting the code and not in the real code?).

If not this, it may be that crazy old bug in .Net where it has some confusion between your system locale setting and user locale setting, if they don't match. Or some such nonsense like that...

Richard Muller

Posts: 10
Nickname: rlmuller
Registered: Mar, 2003

Re: Problem with assembly for a sample app Posted: Apr 4, 2003 6:02 PM
Reply to this message Reply
Hi Matt,

Many thanks for your reply. You've got sharp eyes. The space that you noticed is due to a error in the font; perhaps it has some funny kerning rule. I reposted that line below, again with [code] font, and definitely no space in my source code.

[code]imageList2.ImageStream = (System.Windows.Forms.ImageListStreamer)resources.GetObject("imageList2.ImageSt ream");


More importantly, in checking out the error you noted,
I recompiled the project and the error disappeared. I don't believe I made a single change in the project.

I think the method I used to test the sample code is faulty, as evidenced by the earlier failure, so I'd like to know the proper way to build a project given merely a few .cs files.

I took a different approach, which produced a different symptom. I'll post about after I explore it further.

Again, thanks for your response.

Regards,
Richard

Flat View: This topic has 2 replies on 1 page
Topic: Creating Word toolbar problem Previous Topic   Next Topic Topic: pixel detection

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use