I created this program on XP in .net 3.5. Recently got a Win 7 machine
and had been developing just find on it till I attempted to get the MS
CLR Debugger installed. After some searching I eventually got the 2.0
SDK installed. Ever since then I've been unable to run this program.
After some work I've found that what is happening is a failure for
access a resource in my manifest that was working just find prior to
installation of the 2.0 SDK.
Some back ground on this code. It was written entirely in notepad so I
had no VS IDE to help with this. Only recently started using the CLR
debugger. I've tried importing it into VS 2010 express and with some
work, and removal of the offending code I've gotten it to run again
(without my special icons from the manifest unfortunately).
[code]
this.Icon = new Icon(_Engine.GetResImage("q2icon.ico"));
[/code]
this is calling:
[code]
public Stream GetResImage(string image)
{
Stream icoTemp =
this.GetType().Assembly.GetManifestResourceStream("QLite.q2Icon.ico");
try
{
string[] resourceNames =
this.GetType().Assembly.GetManifestResourceNames();
icoTemp =
this.GetType().Assembly.GetManifestResourceStream("Qlite.Properties.Resources."
+ image);
}
catch(Exception ex)
{
ReportEx(ex, "Engine", "GetResImage");
}
return icoTemp;
}
[/code]
icoTemp is returning a null value. When I look at the manifest through
the ILDASM it appears to be there. In the VS version of this program I
made they display under the resources section of the Solution
Explorer. The string array resourceNames is also returning null.
Prior to my .Net mess up this was working perfectly and still works on
all other machines except this one. There are no build error, the
program simply crashes out before load due to the null value
reception.
I've tried variations on:
icoTemp = this.GetType().Assembly.GetManifestResourceStream(image);
icoTemp = this.GetType().Assembly.GetManifestResourceStream("QLite." +
image);
icoTemp =
this.GetType().Assembly.GetManifestResourceStream("Qlite.Properties.Resources."
+ image);
None of these have worked. During execution if I step through the code
it appears as though the manifest is empty. I don't see how this is
possible as the files display within the solution explorer and when I
run the same code on other machines it works perfectly. Any idea's out
there?
This seemed to happen after installing the x86 version of the 2.0 SDK
on a 64 machine which then led to issues running the CLR debugger. I
eventually installed both x86 and x64 then uninstalled them both. It
appears as though I can't completely uninstall the 2.0 framework on
Win 7 though so I feel kind of stuck there. Have reinstalled
3.0/3.5/3.5.1/4.0 and the Win7 SDK 4 TIMES to no avail. I feel as
though this is really just a bad .net framework installation that I've
been unable to correct (if anyone has any ideas as to how I'd be much
obliged), since it is only this machine that it fails to run on. I've
since uninstalled all .Net installs I could find, ran the .Net clean
up utility twice and the MSDE clean up utility. I am able to remove
all of .Net except for the non x64 2.0 stuff.
I have then reinstalled .Net 2.0 SDK for the CLR debugger, then the
Windows 7 SDK with 4.0 .Net full. Then I installed VS 2010 and have
been able to get it to run within VS but if I attempt to run (even the
exe compiled via VS 2010) outside of Visual Studio it will crash even
more horribly than it did before (red 'x's where there should be menu
toolbars and such).
If anyone has any idea's as to how to remedy this it would be a great
help, thanks in advance.