|
Hello,
I am having a problem with the .Net Framework bootstrapper program from Microsoft's website. I'm using it to install my program, and at the end of the installation the bootstrapper program asks the user if they want to reboot the system (this is required because the program will not run correctly without being rebooted). However, when you push Yes, it doesn't reboot.
I've only had this problem with Windows 98. Has anyone else had a problem like this?
|
|
|
|
|
You should check the Microsoft Knowledge Base or post a question to the relevent newsgroup. They did not post any known issues with the bootstrapper (I've seen and tried it before) so there must be a bug that worked its way in and the KB and newsgroups are the best place to get that resolved...not the C# forum!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have an assembly in the GAC, but I cannot load it. I get the following error:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: File or assembly name Microsoft.ApplicationBlocks.Logging.EventSinks, or one of its dependencies, was not found.
That is all the information I have. The assembly is in the GAC, so it must be one of its dependencies that is missing, but I cannot figure out which.
Here is the MANIFEST content from ildasm:
.assembly extern Microsoft.EnterpriseInstrumentation
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 7:0:5000:0
}
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern System
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern System.Xml
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern System.Data
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:5000:0
}
.assembly extern mscorlib as mscorlib_5
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:3300:0
}
.assembly extern Microsoft.ApplicationBlocks.Logging.Schema
{
.publickeytoken = (64 F1 8B 94 EB E8 62 97 )
.ver 1:0:0:0
}
.assembly extern System as System_7
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:0:3300:0
}
.assembly extern System.Messaging
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 1:0:5000:0
}
.assembly extern System.Management
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 1:0:5000:0
}
.assembly Microsoft.ApplicationBlocks.Logging.EventSinks
{
.custom instance void [mscorlib]System.Reflection.AssemblyDelaySignAttribute::.ctor(bool) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyCopyrightAttribute::.ctor(string) = ( 01 00 22 43 6F 70 79 72 69 67 68 74 20 C2 A9 20
4D 69 63 72 6F 73 6F 66 74 20 43 6F 72 70 6F 72
61 74 69 6F 6E 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyKeyNameAttribute::.ctor(string) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyKeyFileAttribute::.ctor(string) = ( 01 00 4A 44 3A 5C 50 72 6F 67 72 61 6D 20 46 69
6C 65 73 5C 4D 69 63 72 6F 73 6F 66 74 20 41 70
70 6C 69 63 61 74 69 6F 6E 20 42 6C 6F 63 6B 73
20 66 6F 72 20 2E 4E 65 74 5C 4C 6F 67 67 69 6E
67 5C 6C 6F 67 67 69 6E 67 2E 73 6E 6B 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyTrademarkAttribute::.ctor(string) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 05 44 65 62 75 67 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyDescriptionAttribute::.ctor(string) = ( 01 00 24 70 61 74 74 65 72 6E 73 20 26 20 70 72
61 63 74 69 63 65 73 20 4C 6F 67 67 69 6E 67 20
54 6F 6F 6C 6B 69 74 00 00 )
.custom instance void [mscorlib]System.Runtime.InteropServices.ComVisibleAttribute::.ctor(bool) = ( 01 00 00 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 15 4D 69 63 72 6F 73 6F 66 74 20 43 6F 72
6F 70 72 61 74 69 6F 6E 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 24 70 61 74 74 65 72 6E 73 20 26 20 70 72
61 63 74 69 63 65 73 20 4C 6F 67 67 69 6E 67 20
54 6F 6F 6C 6B 69 74 00 00 )
.custom instance void [mscorlib]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 24 70 61 74 74 65 72 6E 73 20 26 20 70 72
61 63 74 69 63 65 73 20 4C 6F 67 67 69 6E 67 20
54 6F 6F 6C 6B 69 74 00 00 )
.custom instance void [mscorlib]System.CLSCompliantAttribute::.ctor(bool) = ( 01 00 01 00 00 )
.permissionset reqmin = (3C 00 50 00 65 00 72 00 6D 00 69 00 73 00 73 00
69 00 6F 00 6E 00 53 00 65 00 74 00 20 00 63 00
6C 00 61 00 73 00 73 00 3D 00 22 00 53 00 79 00
73 00 74 00 65 00 6D 00 2E 00 53 00 65 00 63 00
75 00 72 00 69 00 74 00 79 00 2E 00 50 00 65 00
72 00 6D 00 69 00 73 00 73 00 69 00 6F 00 6E 00
53 00 65 00 74 00 22 00 0D 00 0A 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 76 00 65 00 72 00
73 00 69 00 6F 00 6E 00 3D 00 22 00 31 00 22 00
3E 00 0D 00 0A 00 20 00 20 00 20 00 3C 00 49 00
50 00 65 00 72 00 6D 00 69 00 73 00 73 00 69 00
6F 00 6E 00 20 00 63 00 6C 00 61 00 73 00 73 00
3D 00 22 00 53 00 79 00 73 00 74 00 65 00 6D 00
2E 00 53 00 65 00 63 00 75 00 72 00 69 00 74 00
79 00 2E 00 50 00 65 00 72 00 6D 00 69 00 73 00
73 00 69 00 6F 00 6E 00 73 00 2E 00 53 00 65 00
63 00 75 00 72 00 69 00 74 00 79 00 50 00 65 00
72 00 6D 00 69 00 73 00 73 00 69 00 6F 00 6E 00
2C 00 20 00 6D 00 73 00 63 00 6F 00 72 00 6C 00
69 00 62 00 2C 00 20 00 56 00 65 00 72 00 73 00
69 00 6F 00 6E 00 3D 00 31 00 2E 00 30 00 2E 00
35 00 30 00 30 00 30 00 2E 00 30 00 2C 00 20 00
43 00 75 00 6C 00 74 00 75 00 72 00 65 00 3D 00
6E 00 65 00 75 00 74 00 72 00 61 00 6C 00 2C 00
20 00 50 00 75 00 62 00 6C 00 69 00 63 00 4B 00
65 00 79 00 54 00 6F 00 6B 00 65 00 6E 00 3D 00
62 00 37 00 37 00 61 00 35 00 63 00 35 00 36 00
31 00 39 00 33 00 34 00 65 00 30 00 38 00 39 00
22 00 0D 00 0A 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 76 00 65 00 72 00 73 00 69 00
6F 00 6E 00 3D 00 22 00 31 00 22 00 0D 00 0A 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00
46 00 6C 00 61 00 67 00 73 00 3D 00 22 00 45 00
78 00 65 00 63 00 75 00 74 00 69 00 6F 00 6E 00
22 00 2F 00 3E 00 0D 00 0A 00 3C 00 2F 00 50 00
65 00 72 00 6D 00 69 00 73 00 73 00 69 00 6F 00
6E 00 53 00 65 00 74 00 3E 00 0D 00 0A 00 )
.publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00
00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00
ED 84 12 34 D6 BD 34 30 A7 EC F3 18 DF 15 E9 5C
F7 89 AF 55 0A 35 20 24 CD 27 DA 48 F3 16 F3 77
2A 82 ED F0 31 E2 8F 21 2B AE 25 1F C1 2A AA ED
D9 4F 04 E9 C9 96 4A AF C0 59 E7 BB 59 86 5E 0B
2D 58 66 6E CC 9D 42 29 DA E3 2C 14 C8 57 72 0E
ED 0C BA 63 8C 2F E6 AD 57 08 F1 8E 26 0A 29 A4
0A 45 36 42 A7 66 A4 D7 7C B8 22 E0 6B B2 1D 50
1E 24 C0 BA 86 15 14 11 BE FC 0B 52 B5 2E 55 A3 )
.hash algorithm 0x00008004
.ver 1:0:0:0
}
.mresource public Microsoft.ApplicationBlocks.Logging.EventSinks.data.xsd
{
}
.mresource public Microsoft.ApplicationBlocks.Logging.EventSinks.EventSinks.resources
{
}
.module Microsoft.ApplicationBlocks.Logging.EventSinks.dll
.imagebase 0x11000000
.subsystem 0x00000003
.file alignment 4096
.corflags 0x00000009
Can anyone tell me where to look?
Tx
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Look for each assembly referenced at the top of your MANIFEST and make sure that it exists in the GAC and that the version is the same. For the Microsoft assemblies, open each one in ildasm.exe and make sure their dependencies are there. Basically, just make sure that the libraries are installed correctly.
Also, I noticed that your assembly reference both the .NET 1.0 and 1.1 versions of mscorlib.dll. While unusual, it obviously compiled but you must make sure that both .NET 1.0 and 1.1 are installed on the client machine (assuming this is on a different machine than what you compiled on).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
If you run fuslogvw, you can see what fusion is doing when it's trying to load your assembly. That usually helps me.
|
|
|
|
|
I've figured out how to handle an external > Internal drag drop on a form, the transition of objects to streams is easy enough. The reverse would be the same, but I don't know how to detect external drops, and what path they are being dropped into.
Can anyone help?
Cheers
Cata
|
|
|
|
|
Without system hooks, you can't. You have to pack the data - each with an appropriate clipboard format - and if the target supports that clipboard format, it extracts the data. There are a number of clipboard formats used throughout the Windows shell and that other programs uniformely support (like for text, unicode text, HTML files, etc.). If you use the clipboard formats and pack the data into the IDataObject correctly, the target will take care of the rest.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
So how would I go about determining the target?
I was thinking of doing it by retrieving a file path from the destination, and constructing a file using a stream to that path. But you say that won't work.
How do I set up system hooks?
Cheers
Cata
|
|
|
|
|
The target is responsible for unpacking the data based on clipboard formats it supports. There are no notifications for a drop target event.
As far as Windows hooks go, this would be an extremely difficult - and only hypothetically possible - process. You'd have to watch for particular messages but it would bog down the system incredibly for such a trivial end.
You should read about dragging and dropping in the Shell section of the Platform SDK on MSDN Online. Basically, all you can do is pack data into an IDataObject in .NET. To provide a stream or you have to resort to Win32's IDataObject (different than .NET's) and P/Invoke several methods (the ones that dragging and dropping, and the clipboard functions use internally in the .NET BCL) and create LOTS of structures. Reading about things like STGMEDIUM and FORMATETC should shed some light on this.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ok, thanks mate.
I will look it all up and figure things out.
Always the best way.
Cata
|
|
|
|
|
Yes it is. Unfortunately, solving your problem with Win32's drag-n-drop is not easy and reading about it is necessary before I could even explain half of the stuff to you (otherwise I end up writing a book! ). So, while you can't be notified of drop operations in another app (unfortunately, this is a problem that many people have asked about), you can use native dragging and dropping to provide a stream when the other application asks for it - just make sure that you use common clipboard formats that the other app supports (like the Windows Shell supports the CF_HDROP while specifying TYMED_ISTREAM to pass a stream reference that the Shell can read, or something like that).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
Can anyone tell me how I can determine how much memory, disk space, and free disk space are on a computer programmatically? This will be displayed on a windows form.
I'm thinking it's got to be in one of the dlls that come with windows, but I don't know which one and what functions to use.
Thanks!
|
|
|
|
|
Instead of P/Invoking native methods, this is a perfect opportunity to use WMI (see the System.Management namespace). In fact, there's already several great tools to help you. This also allows you to query remote computers where the native functions won't always allow you to do that.
VS.NET makes it even easier. Show your Server Explorer tab, expand your computer, then Management Classes, then My Computer and select your computer. You'll notice the property grid has a lot of information you want. Simply drag that to your form and it creates an easy-to-use wrapper class for querying that management information. You can change the computer name and get that information for other computers as well.
For disk infomration, you should've noticed the Disk Volumes class right above My Computer. You can create a management class wrapper for that, too, and then specify the path and get the drive's information.
You could use the following native functions, but querying information for other computers isn't as easy (GetDiskFreeSpaceEx can use UNC paths, but they must have a trailing backslash (\) and require a share on the machine to query):
[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
public static extern bool GetDiskFreeSpaceEx(string root,
out long freeBytesToCaller,
out long totalBytes,
out long freeBytes);
[DllImport("kernel32.dll")]
public static extern void GlobalMemoryStatus(out MemoryStatus status);
[StructLayout(LayoutKind.Sequential)]
public struct MemoryStatus
{
public int length;
public int memoryLoad;
public long totalPhysical;
public long availablePhysical;
public long totalPageFile;
public long availablePageFile;
public long totalVirtual;
public long availableVirtual;
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath,
Thanks for your help, but I can not find the System.Management namespace. Where is this namespace located and or how do I add it? I tried using System.Management; but that doesn't work.
Thanks
|
|
|
|
|
Sorry,
I figured out that I didn't add the reference. Hey, it's a Monday morning.
Thanks
|
|
|
|
|
Look at the System.Management namespace
ManagementObject disk = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");
disk.Get();
object freeSpace = disk.Properties["FreeSpace"].Value;
Jonathan
|
|
|
|
|
I am running an application that uses a managed image list of icons pulled from the System kernel that uses extentions to look them up via a modified version Heath's little GetFileInfo source code.
The problem I have is, while my embeded resources, or any opened from the directory work fine in my XP visualStyle, with the alpha filtered ONLY at 32 bit ImageList settings, those that I pull from the system are still blocky and suffering from alpha textures showing up.
I am not sure what to do about this, I have written an algorythm to convert the pixels to RGB, but that leaves them on a black background. I don't understand why it occurs, as it does not occur else where.
Any ideas as to why?
Cheers
Cata
|
|
|
|
|
By definition, alpha channels require 32-bit images because the first 24 bits are the colors (RGB) while the last 8 bits are the alpha channel.
As far as the problem goes, this has to do with the common controls version. If you use XP Visual Styles (either look at my article detailing this, or - for .NET 1.1 and up - call Application.EnableVisualStyles before calling Application.Run ) most of the image handling code is redirected to common controls 6 (a side-by-side native assembly), which understands alpha channels. If not, the alpha channel gets converted to a close color like you've seen. .NET may understand alpha channels implicitly (which is why your embedded images with alpha channels work), but when pulling icons using file associations, you need enabled XP Visual Styles. This worked for me.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I've enabled the VisualStyles, with the DoEvents() methods.
Without those, even the embeded icons show the alpha texture.
I know it works, as the embedded icons, and those that I import from files (I unpacked the system icons from the DLL to experiment with them, and they work too), all come without the alpha.
What I don't understand is, when I construct the bitmaps from an icon handle, pulled from shell32, no matter what I do, the alpha is still there.
It's confusing me, because I can clearly see things working in some areas and others not.
I've set all my image lists to 32bit, and also added numerous 32bit reset points to test whether it was a drop in image quality that caused this. Still no luck.
Any ideas?
Cata
(I have a screen shot of the anomaly, if anyone wants a look. It's confusing indeed...)
|
|
|
|
|
Ok, I found out that the problem lay in the extraction process.
Basicaly, when the icon is pulled from shell32, it was converted straight into a Bitmap, and then returned, before being added to the image list.
By leaving it as an Icon, and backing this up to the point where it is added to the image list, the Alpha is now recognised and removed. I guess that it looks for alpha in icons, but not in bitmaps.
Anyway, I am happy now.
Regards
Cata
|
|
|
|
|
Hello!
I found that the inline code documentation defined on the classes and methods does not get compiled into assembly! When looking into object browser, the documentation is only visible for the items found under project node. When coding in the project referencing the library containing the documentation, I only get class/method/argument names but no single word in addition.
The MSDN documentation says that the /doc compiler option should be used to produce xml file which could be used by IntelliSense - the file should have the same name as the assembly produced. I tried it but with no the effect.
What do I do wrong?
Thanks for any suggestions.
Vasek
VB6, C#, MS DNA, MS.NET
Software Developer
|
|
|
|
|
using: /doc:file
The file should have the same name as the assembly but with xml extension:
MyLib.dll
MyLib.xml
These should be kept together in the same folder.
|
|
|
|
|
Hi, this exactly I made but I made it using IDE, I did not run compiler from the command line. There is /doc configuration option int the project setting. The file was created but the documentation was not inserted to the compiled file.
Could you tell me, whether the /doc: dicrective works for you?
Thanks
Vasek
VB6, C#, MS DNA, MS.NET
Software Developer
|
|
|
|
|
Yes, I also do it using the IDE "XML Documentation File" setting and the documentation is put in the specified .xml documentation file. It is not supposed to be put in the compiled file.
|
|
|
|
|
Hello,
I'm trying to use the Microsoft.Win32.Registry namespace for getting owner information from the registry. I found that this namespace isn't supported by .net compact framework and that i have to use Win Api functions and to import coredll .dll
But I don't know how can I fix my problem:
I have to
[DllImport("coredll.dll")]
and then to use RegCreateKeyEx(..) and RegCreateKeyEx(..)
LONG RegCreateKeyEx ( HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult, LPDWORD lpdwDisposition );
LONG RegQueryValueEx( HKEY hKey, LPCWSTR lpValueName,
LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData );
but I don't know how to transform types of parameters for using this functions in c# and to use the macro like HKEY_CURRENT_USER
thank you for your time.
Ramona
|
|
|
|
|