.NET framework 4.7.2 assembly loading with BuildManager

Nam Nguyen 0 Reputation points
2024-04-11T07:09:39.3666667+00:00

Hi,

My .net project uses a skeleton library that calls BuildManager.GetReferencedAssemblies in .NET framework 4.7.2 to get assemblies in order to initialize modules to start the application. 

⚠️It was observed that the function returned an AssemblySet having different indexes in each execution. if the app modules (or assemblies) are dependent and need to be run in a sequence, the app start will be failed.

Example:

  • The first execution: (A, B, C)
  • The second execution: (C, B, A)
  • The third executuion: (B, A, C)

https://learn.microsoft.com/en-us/dotnet/api/system.web.compilation.buildmanager.getreferencedassemblies?view=netframework-4.7.2

Can anyone give advice for this issue?

Is there any environmental config to ensure the index is same always?

Many thanks.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,484 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.