.NET Framework Configuration

When working in .NET, you may encounter these two errors: System.IO.FileNotFoundException and System.Security.SecurityException. Read this topic to learn why these errors occur and how to handle them.

System.IO.FileNotFoundException Error

When you run a VBVoiceapplication that was built in an earlier version of VBVoice.NET, you will get a System.IO.FileNotFoundException error. This occurs because the .NET Framework is looking for the version of the VBVoiceDotnetInterface.dll that the application was built with, but this library no longer exists.

Three Possible Workarounds

Package the old VBVoiceDotnetInterface.dll

You can package the old VBVoiceDotnetInterface.dll with the binary.

Re-compile with New VBVoiceDotnetInterface.dll

You can re-compile the project with the new VBVoiceDotnetInterface.dll.

Configure the Microsoft .NET Framework

To configure the Microsoft .NET Framework:

  1. Start mscorcfg.msc or run Microsoft .NET Framework Configuration from the Control Panel Administrative Tools

  2. Select Add Application to Configure in the right pane

  3. Choose the application you would like to configure and click OK

  4. Select Managed Configured Assemblies in the right pane

  5. Select Configure an Assembly in the right pane

  6. Select Choose an Assembly from the assembly cache

  7. Click on Choose Assembly

  8. Locate and select VBVoiceDotNetInteface.dll

  9. Click on Finish

  10. Select the Binding Policy tab from the VBVoiceDotNetInterface Properties

  11. Enter the Requested Version and the New Version (for example, Requested Version = 5.1.88.0 and New Version = 5.1.102.0)

  12. Click OK to restart Visual Studio

System.Security.SecurityException Error

When you try to create a project on a UNC path, a System.Security.SecurityException error occurs when you then compile or run the .NET VBVoice application over the LAN. This error occurs because a UNC path is not a trusted location for a project. Your project may not run correctly when you attempt to debug or run from this location.

Give a File Share FullTrust Permission

To give a file share FullTrust permission:

  1. Start mscorcfg.msc or run Microsoft .NET Framework Configuration from the Control Panel Administrative Tools

  2. Expand the Runtime Security Policy node, the Machine node, the Code Groups node, the All_Code node, and then highlight the LocalIntranet_Zone node

  3. Select Add a Child Code Group in the right pane

  4. Choose Create a New Codegroup

  5. Enter a name for the code group and then click Next

  6. Choose a Condition Type of URL

  7. Enter the UNC path to the share location of your project, using the format file///\\servername\sharename\* where \\servername\sharename is the name of the share

  8. Note: Make sure to add the asterisk (*) to the end of the path

  9. Click Next

  10. Choose Use Existing Permission Set of FullTrust

  11. Click Next

  12. Click Finish

  13. Restart Visual Studio