views:

67

answers:

3

I can’t made my .NET 2.0 applications (and services) to load their appname.exe.config files on Windows Server 2003 Standard Edition SP2,

I tried to create manifest like this but it didn’t worked

EDIT:

  • Appname.config is located in the same dir,
  • App works without any changes on Windows XP, once we move files or use setup to install it on 2003 it fails to load .config file.
  • The "working directory" of the executable IS the same as it's path! We didn’t change anything while moving it from XP to 2003

I’ve tried process monitor, it says for operations CreateFile and QueryOpen: name not fount, like this file would not exists, but I assure, it is!

I think it might be something wit manifest files under 200, according to this thred on MS Connect

but I don’t know how to solve the problem.

A: 

What do you mean by cannot load? Any exception message .Net throws at you? Or it just dies silently?

Your app should load yourexe.exe.config, i.e., mainform.exe.config, where mainform.exe is your app name.

Ngu Soon Hui
Thanks, I meant appname.exe.config (I corrected that) - it fails to load, I also tired appname.config (without “.exe”) as I found on the web that it could solve the problem, however neither of this worked.
michael
+1  A: 

Two things come to mind: First, is the config file located in the same directory as the executable?

Second, is the "working directory" of the executable the same as it's path? If the working directory isn't correct, then it won't be able to locate the file.

One more thing to do would be to get a copy of sysinternals, specifically the process explorer tool to see what file (and path) it's trying to load.

Chris Lively
Non of that, I'm afraid, but thanks I also check the process monitor and it says name not found while opening appname.config file, I think it might be something with manifest file
michael
+1  A: 

This might be the solution:

http://blogs.msdn.com/junfeng/archive/2006/08/09/692996.aspx

To workaround the bug, add an assemblyIdentity to the SxS manifest.

<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity
    version="1.0.0.0"
    name="Foo"
    type="win32"
  />

  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="asInvoker"
          uiAccess="false"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
Scott Langham

related questions