Posted 15 years ago by Alexnaldo Santos
Version: 4.0.0280
Platform: .NET 3.5
Environment: Windows Vista (32-bit)
Avatar
Hi,

At startup I do :
_dotNetProjectResolver.CachePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Cache");
SemanticParserService.Start();
_dotNetProjectResolver.AddExternalReference("...my assembly");

The "Cache" doesn't detect assembly updates. If I put more methods in "my assembly" I can't see it in the "Intellisense", only after delete all files in the "Cache" and re-start the application.

Regards,
Alexnaldo Santos

Comments (9)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Alexnaldo,

It should auto-refresh between application sessions. So once you restart your application it will auto-reload.

To refresh an assembly manually during an application session, you can call a AssemblyCodeRepository.Refresh method. That is there for people who compile assemblies in their apps and want to refresh the data immediately.


Actipro Software Support

Posted 15 years ago by Alexnaldo Santos
Avatar
Does "auto-refresh" compare Assembly Version or File Version ?
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Alexnaldo,

Actually it will compare things like date/time modified, size, etc.


Actipro Software Support

Posted 10 years ago by Yumin Shen - Infinera Corpration
Avatar

Hi, I have the same issue. How can I use the function AssemblyCodeRepository.Refresh? I use a file path to load the reference so I do not have an assembly object to use.

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Yumin,

You should be able to call projectResolver.RemoveExternalReference(path) and then do projectResolver.AddExternalReference(path) right after.  I believe that will refresh it for path-based assemblies.


Actipro Software Support

Posted 10 years ago by Yumin Shen - Infinera Corpration
Avatar

Thanks I have tried that. First projectResolver.RemoveExternalReference(path) will not remove the reference. I have to remove it with its full name found in the collection. Secondly, after confirmed removal of the old one, the new added by path will not update the reference either. I have tried to add reference by a loaded assemly object and refresh using AssemblyCodeRepository.Refresh wtih the exactly same assembly object but no success either. I guess I have to use the assembly get from projectResolver or its  Intellisense appdomain?

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Yumin,

Do you have a simple sample project that you can send over that shows the issue?  Then we can use that to debug it and see what's happening.  If so, please email it to our support address and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 10 years ago by Yumin Shen - Infinera Corpration
Avatar

Hi, 

I have find the way to make it work.

What I have found out are

1) projectResolver.RemoveExternalReference(assmName) has to use the full name of assembly found in projectResolver.ExternalReferences, file path does not work

2) Remove and add same updated reference file (with different size and date) but without changing assembly version number does not update the reflection information due to the cache is not refreshed. (it will update to the correct info after application restart, as expected). Changing file version or use different file name does not work either. It seem inconsistant with the second reply you provided so I though maybe it is better to put it here for others references.

To make it work, I have to change the assembly version number every time I create an updated dll file. 

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

What if you do this sort of sequence of events:

1) If the assembly is already loaded, get its full name and call projectResolver.RemoveExternalReference on it.

2) Rebuild the assembly.

3) Call projectResolver.PruneCache.

3) Use projectResolver.AddExternalReference(path) to add a new copy.

Does that help at all?


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.