I've written a test program that shows that .manifest files and
.config files won't work together when the app is run from a UNC path.
Has anyone fixed this problem?
To recreate the problem:
1. create an app named UNCTest with 1 button and 1 label on it. Add
the following code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Label1.Text = ConfigurationSettings.AppSettings("AttachRoot") &
"xyz"
End Sub
2. Add the following UNCTest.exe.manifest file to the project.
<?xml version="1.0" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Winweb.UNCTest"
type="win32"
/>
<description>.NET control deployment tool</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
3. Add the following app.config file to the project:
<?xml version="1.0" ?>
<configuration>
<appSettings>
<add key="AttachRoot" value="\\test\test\test\test\" />
</appSettings>
</configuration>
4. compile the application and put it out on the network. Make sure to
manually copy the .manifest file - it doesn't automatically move the
bin folder like the .config file does.
5. map a drive to the network share where you put the exe and run the
program. No problems when you click the button - you should get
\\test\test\test\test\xyz in the label
6. run the program from a UNC (\\server\folder\UNCTest.exe). You
should get a different result - just xyz (it's not reading the value
from the .config file correctly).
I've seen several Usenet messages about removing encoding from the
.config and/or .manifest files - I've tried this and it doesn't work
(note the two files above don't have encoding attributes). I can't
use Application.EnableVisualStyles, either, b/c this blows up my app
(even if I use Application.DoEvents right after).
So, is there any OTHER workaround so I can enable XP styles, AND use a
config file, AND run my app from a UNC path?
matt tag