This forum has been archived. Please start a new discussion on GitHub.

System.IO.FileNotFoundException: Could not load file or assembly


We've just upgraded from Ice 3.0.1 to Ice 3.2.1 and we are having a lot of trouble when trying to use Ice through c#.

We have regenerated the .cs files using slice2cs, and the project compiles against them; however, when we try and run the project, we are getting a strange FileNotFound exception which seems to be causing an Ice.NoObjectFactoryException.

The actual file/assembly that is being reported as missing seems to be different each time; it varies between vs classes and other dependent libraries of the project.

This happens both when you run the project from within VS2005, as well as when you run the binaries outside of VS.

This did not used to happen when we were on 3.0.1, and our c++ and java libraries have been upgraded to 3.2.1 using the same slice files, so I am very unsure what the problem is here.

ML.EquityLinked.Gps.Vision.Parameters.ParameterDataException: Failed to Load Data ---> Ice.NoObjectFactoryException
reason = (null)
type = "::paramarama::Parameter"
at Ice.ObjectPrxHelperBase.handleExceptionWrapper__(ObjectDel_ delegate, LocalExceptionWrapper ex) in f:\src\vc80\stage\debug\IceCS-3.2.1\src\Ice\Proxy.cs:line 995
at correlations.ParameterServicePrxHelper.getCurrentValidParameters(Key[] specs, Context context__, Boolean explicitContext__) in C:\projects\nepx\paramarama\correlations.cs:line 2887
at correlations.ParameterServicePrxHelper.getCurrentValidParameters(Key[] specs) in C:\projects\nepx\paramarama\correlations.cs:line 2860
at ML.EquityLinked.Gps.EPX.IceParameterService.GetCurrentValidParameter(Key id) in C:\projects\nepx\MerrillLynch.EPX\IceParameterService.cs:line 97
at ML.EquityLinked.Gps.Vision.Parameters.EpxApiWrapper.GetEpxXml(String key_, String type_, String source_, String format_, DateTime validTime, Metadata& meta_) in C:\projects\GPSVision\Vision.ParameterData\EpxApiWrapper.cs:line 480

Caused by: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Vbe.Interop, Version=10.0.4504.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at IceInternal.AssemblyUtil.loadReferencedAssemblies(Assembly a) in f:\src\vc80\stage\debug\IceCS-3.2.1\src\Ice\AssemblyUtil.cs:line 163
at IceInternal.AssemblyUtil.loadAssemblies() in f:\src\vc80\stage\debug\IceCS-3.2.1\src\Ice\AssemblyUtil.cs:line 149
at IceInternal.AssemblyUtil.findType(String csharpId) in f:\src\vc80\stage\debug\IceCS-3.2.1\src\Ice\AssemblyUtil.cs:line 56
at IceInternal.BasicStream.loadObjectFactory(String id) in f:\src\vc80\stage\debug\IceCS-3.2.1\src\Ice\BasicStream.cs:line 1806


  • matthew
    matthew NL, Canada
    I suspect you've run into a problem where Ice tries to load, and fails, assemblies that are referenced at design time, but are not actually present upon target machines, and never actually used during the run time.

    Please try the attached patch, and let me know if that resolves the problem.
  • That worked a treat, thanks so much!
  • looks like this patch is missing in 3.3.0 as well.

    take care