Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. AppDomain - Loading a assemly

AppDomain - Loading a assemly

Scheduled Pinned Locked Moved C#
csharpvisual-studiotestingbeta-testingquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AJ123
    wrote on last edited by
    #1

    I am creating a testing harness for my app and merrily loading assemblies using reflection into a seperate app domain. What i was hoping to be able to do is unload the App Domain - releasing the file lock on the Assemblies. Allowing me to have write access to rebuild them in Visual Studio. Unfortunately the app still has locks on the assemblies. Can anyone think of what i might be missing? The code goes something like this: 1) Assembly assembly = reflectionDomain.Load(filename); 2) AppDomain.Unload(reflectionDomain); Anyone any clues? Cheers Rich

    L 1 Reply Last reply
    0
    • A AJ123

      I am creating a testing harness for my app and merrily loading assemblies using reflection into a seperate app domain. What i was hoping to be able to do is unload the App Domain - releasing the file lock on the Assemblies. Allowing me to have write access to rebuild them in Visual Studio. Unfortunately the app still has locks on the assemblies. Can anyone think of what i might be missing? The code goes something like this: 1) Assembly assembly = reflectionDomain.Load(filename); 2) AppDomain.Unload(reflectionDomain); Anyone any clues? Cheers Rich

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      There is a known issue with file locks when images are involved. Image.FromFile(fileSpec) keeps fileSpec open; a work-around consists of a small class that immediately copies the image to another image, and then disposes of the original. Maybe that's what you are experiencing... :)

      Luc Pattyn

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups