none
APP works ok on machine it was built on, but copied to other machine, it fails. RRS feed

  • Question

  • I am trying to build an app that calls a stored procedure on an SQL database that is on a Server machine separate from my development meachine.

     

    It seems to work ok when executed from my development machine, but when I copy the program to another machine and exectue it from there, it does not work so well.

     

    I used mscorcfg.msc to change the intranet settings so that my development machine can run the executable from the server directory, but other machines still cannot execute the program off the server directory!

     

     

    I have used the mscorcfg.msc on other machines to permit execution from the intranet, but this did not help.

     

    I have used  sn.exe to create a key pair. 

     

     

    The vs vc++ 2005, the MFC app wizzard generated a project with 6 .cpp files.

     

    In <projectname>.cpp, I added:

     

    using namespace System;

    using namespace System::Reflection;

    [assembly:AssemblyKeyFileAttribute("C:\\ENVISIONWORKSHOP\\RELEASE\\VEC2SQL.SNK")];

    [assembly:AssemblyVersionAttribute("2.0.4.1")];

     

    Then in the specified directory, I execute:

    sn -k VEC2SQL.SNK

     

     

    (Do I have to repeat for every .cpp file?  Doesn't seem logical since library objects would be a real treat.  Does it have to be copied to the  .cpp files that use the "using namespace" declarations?)

     

    When I build this app with a manifest I get the build warning:

     

    1>mt.exe : general warning 810100b3: ..\..\Release\VEC2SQL.exe is a strong-name signed assembly and embedding a manifest invalidates the signature. You will need to re-sign this file to make it a valid assembly.

     

    .. And the program will not run at all.

    .NET Framework 2.0 Configuration > Assembly Cache > Add > browse to vec2sql.exe > bresults in dialog box:

    "Unable to add the selected assembly.  The assembly must have strong name (name, version, and public key)."

     

     

     

     

     

    If I build without a manifest, it gets as far as

    "This application has failed to start because MFC80U.DLL was not found.  Re-installing the application may fix this problem."

     

    But .NET Framework 2.0 Configuration does allow me to add the assembly to the "assembly Cache" and from there to the "configured Assemblies" list.  But it does not allow me to modify the [ Runtime Security Policy > Increase Assembly Trust > Make changes to this computer > browse to vec2sql.exe >Next ]  results in error dialog box: "Unable to load assembly: C:\ENVISIONWORKSHOP\RELEASE\VEC2SQL.EXE"  with no descriptive error indication!

     

     

    Any ideas?

    Wednesday, August 29, 2007 3:59 PM