Unity application block 2.0 - The given assembly name or codebase was invalid

前端 未结 7 1551
-上瘾入骨i
-上瘾入骨i 2021-01-04 03:26

Interfaces (In the assembly named \"Interfaces\". In project :- Interfaces)

namespace Interfaces
{
    public interface IDoSomeWork1
    {
          


        
7条回答
  •  迷失自我
    2021-01-04 04:26

    Before I answer my question, I must state that the code posted above didn't give me any problem (build error etc.). It just gave me the error I stated in my question. The problem with Unity at this point of time is that It does not provide which assembly or a which types in the assembly could not be loaded. This is a requested feature.

    In my case It was a missing assembly problem. I didn't reference Entities assembly in to the client application project. It seems that that "Entities" assembly could be resolved only at the run-time (since it didn't give me any compile time error). However, the run-time error was also not useful at all.

    I had a look a Fusion Log viewer (It should be in the .NET SDK folder). What a gem of an utility It is. It can log all kind of assembly bindings (all or only failures) and It give a very neat description of which assembly could not load. Very helpful! FailedToLoadAssemblyDetected

    Log

    So, next time, you get this "The given assembly name or codebase was invalid" error, try Fusion Log Viewer. It wont help you in finding which types couldn't be loaded. However,at least you will be sure all your assemblies are getting loaded correctly.

提交回复
热议问题