This project is read-only.

FileNotFound "AlphaVSS.60.x86.d" with VssUtils.LoadImplementation();

Jul 28, 2011 at 4:59 PM

Hello !

 

I'm using the lastest version of AlphaVSS with Visual Studio 2010 Express on a Windows 7 32bits.

I've added AlphaVSS.Common and AlphaVSS.60.x86 assmblies to my solution but this simple code generate a FileNotFoundException for "AlphaVSS.60.x86.dll" (in the source code it is on the Assemble.load() located in the loadImplementation() method) :

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Alphaleonis.Win32.Vss;

namespace ShadowBackup
{
    static class Program
    {
        static void Main()
        {
           
            try
            {
                IVssImplementation vssImpl = VssUtils.LoadImplementation();

                using (IVssBackupComponents backupCmps = vssImpl.CreateVssBackupComponents())
                {

                }
            }
            catch (Exception e)
            {
                MessageBox.Show(""+e);
            }
        }
    }
}

I have the same issue if i try to run the SnapshotQuery.exe provided in the debug folder of the library. I can successfuly run the SnapshotQuery.exe provided in the bin folder.

Do you know what is wrong ?

(I'm still a newbie with C# and MS technologies).

Thanks for your help.

 

Julien

Jul 28, 2011 at 5:19 PM

The executable must be located in the same folder as the AlphaVSS.XXX.dll files for the assembly resolver to be able to find them. (Another option would be to add them to the GAC (Global Assembly Cache)).

Hope this helps.

Sincerely, Peter

Jul 28, 2011 at 5:32 PM
Edited Jul 28, 2011 at 5:34 PM

Well, it seems to work by importing the assembly from the bin folder instead of the debug folder.

@decaf: the executable is located in the same folder. It works using the dll files located in the bin folder but it doesn't work with the dll files located in the debug folder.

Aug 4, 2011 at 5:18 PM

i have this same issue, libraries are in executable folder, doesnt exist in previous build.

oddly enough, i am running this from a network location and the string in the ex.ToString refers to C:\

i'm no expert, but shouldnt that refer to a network location?

System.IO.FileNotFoundException: Could not load file or assembly 'AlphaVSS.60.x64.dll' or one of its dependencies. The specified module could not be found.
File name: 'AlphaVSS.60.x64.dll'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Alphaleonis.Win32.Vss.VssUtils.LoadImplementation()
   at projname.vssClass..ctor(String theOldSource, String theVssVolume) in C:\Users\username\Documents\Visual Studio 2010\Projects\projname\projname\vssClass.vb:line 36

project was convert from vs2k8 .net2.0 to 2k10 .net4.0.

Sep 8, 2011 at 2:39 PM
Edited Sep 8, 2011 at 3:14 PM

I have the same problem on non-dev machines. I'm using VB.net 2010 in x64 mode (on x64 cpu). When I deploy on a machine whitout vs2010 the dll is not found even if it's in the same folder as the .exe.

Machine which fails:

Windows Server 2008r2 w/ .net 4 client profile and extended

Windows Server 7 w/ .net 4 client profile

[edit]

when my tells me it doesn't find the dll, I cannot delete the dll since it's "in use", so the .exe loads it. Could it be a missing depedency?

Sep 8, 2011 at 3:56 PM

I will have a look at this and get back to you with what I find.

I'm pretty sure it finds AlphaVSS.60.x64.dll, since it is probably in the same folder, it is likely a dependency of that one that it doesn't find.  Maybe we need some VC++ redist files that aren't installed?

Anyway, I will take a look and get back to you.

Sep 8, 2011 at 4:14 PM
Edited Sep 8, 2011 at 5:58 PM

2008R2 doesn't have VC+ 2010 redistributable, my workstation does! I'll try thanks!

[edit]

that did the trick! Thank you!! :D

[edit 2]

looks like It's related on which version of the dll (debug / release) I use. I hate the "publish" function of vb.net and I bundle the .exe with another software.

Jun 29, 2012 at 6:24 AM
sirber wrote:

2008R2 doesn't have VC+ 2010 redistributable, my workstation does! I'll try thanks!

[edit]

that did the trick! Thank you!! :D

[edit 2]

looks like It's related on which version of the dll (debug / release) I use. I hate the "publish" function of vb.net and I bundle the .exe with another software.

To expand on this, AlphaVSS.60.x64.dll depends on msvcr100.dll. However, when using the "Debug" version of AlphaVSS.60.x64.dll, it attempts to load the debug version of msvcr100.dll, namely msvcr100D.dll. This file will likely not be a client computer, so resolving this issue will usually entail two steps.

1. Install the VC++ 2010 redistributable.

2. Making sure that the "Release" version, not the "Debug" version of AlphaVSS.60.x64.dll is being deployed.