System.IO.FileNotFoundException was unhandled

2479
9
04-25-2013 06:41 AM
AbhishekSharma
New Contributor II
Hi.

I am trying to migrate a console application from 9.3.1 to 10.1 but dont know this is giving an System.IO.FileNotFoundException was unhandled error.Please help anyone..

I have tried below web but no help so far.
http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000002ns000000



-------------------------------------------------------------------------------------------------------------------------------
System.IO.FileNotFoundException was unhandled
  Message=Could not load file or assembly 'ESRI.ArcGIS.System, Version=9.3.0.1770, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86' or one of its dependencies. The system cannot find the file specified.
  Source=USNG
  FileName=ESRI.ArcGIS.System, Version=9.3.0.1770, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86
  FusionLog==== Pre-bind state information ===

LOG: DisplayName = ESRI.ArcGIS.System, Version=9.3.0.1770, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86
(Fully-specified)
LOG: Appbase = file:///P:/batch/J716120/USNG_1_0_0_2_DEV/USNG_Code/USNG/bin/Debug/
LOG: Initial PrivatePath = NULL

===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: ESRI.ArcGIS.System, Version=9.3.0.1770, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86

  StackTrace:
      
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:



-----------------------------------------------------------------------------------------------------------------------------

error BC30456: 'esriLicenseProductCodeArcView' is not a member of 'ESRI.ArcGIS.esriSystem.esriLicenseProductCode'.

----------------------------------------------------------------------------------------------------------------------------
0 Kudos
9 Replies
NeilClemmons
Regular Contributor III
Make sure the VersionSpecific property on all of your ESRI project references is set to False.  You may also need to remove the references and add them back in.
0 Kudos
AbhishekSharma
New Contributor II
Make sure the VersionSpecific property on all of your ESRI project references is set to False.  You may also need to remove the references and add them back in.


VersionSpecific property is already set to False.removed and added again.no good luck...
any other suggestion.
0 Kudos
NeilClemmons
Regular Contributor III
The error is complaining about not finding the 9.3 version of the System assembly - "ESRI.ArcGIS.System, Version=9.3.0.1770".
Make sure you are referencing the 10.1 version of this file.  The same goes for all of your ESRI references.
0 Kudos
AbhishekSharma
New Contributor II
The error is complaining about not finding the 9.3 version of the System assembly - "ESRI.ArcGIS.System, Version=9.3.0.1770".
Make sure you are referencing the 10.1 version of this file.  The same goes for all of your ESRI references.


Hi Neil.

I am referencing to the 10.1 version only.Please see attached file for detail.
0 Kudos
NeilClemmons
Regular Contributor III
You have 2 errors in your code that need to be resolved.  Try fixing those and see if you still get the error when you run the app.
0 Kudos
AbhishekSharma
New Contributor II
You have 2 errors in your code that need to be resolved.  Try fixing those and see if you still get the error when you run the app.


which 2 errors you are referring to??
error BC30456: 'esriLicenseProductCodeArcView' is not a member of 'ESRI.ArcGIS.esriSystem.esriLicenseProductCode'.??

This error comes when we use 9.3 application in 10.1 before migration.After migration these errors will go.
so no good luck in migration so far.
0 Kudos
NeilClemmons
Regular Contributor III
I'm not really sure what you're trying to say.  If you don't fix those errors then your code will not compile.  If your code will not compile then you aren't going to be migrating anything.  There are only a handful of things you need to do to upgrade the project.  The only thing you'll be left with is to fix any errors due to changes in the ArcObjects libraries, such as the two errors listed in the screen capture you posted.
0 Kudos
AbhishekSharma
New Contributor II
I'm not really sure what you're trying to say.  If you don't fix those errors then your code will not compile.  If your code will not compile then you aren't going to be migrating anything.  There are only a handful of things you need to do to upgrade the project.  The only thing you'll be left with is to fix any errors due to changes in the ArcObjects libraries, such as the two errors listed in the screen capture you posted.


hey Neil.Thanks for your patience.
Okay.Let me say again.
those two errors are before any migration as I have opened it in 10.1 and application was written in 9.3 but when I am trying to migrate my application using run binding, ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine) (as defined by ESRI for migration) in my code,its throws exception as in screen shot,So I am looking a method which should help me to remove these errors and run application without throwing any exception any error.
let me know if still any confusion.
0 Kudos
RichardWatson
Frequent Contributor
My guess is that you project has SpecificVersion = True for your references to the ArcObject assemblies.  Go through your references one by one and make sure that this is False for all references.  Look at the Properties for each reference.
0 Kudos