Strong Name assembly cannot reference non-strong name assemblies

xiaoxiao2021-03-05  28

Want to generate a strong name assembly, reference a type of non-strong name assembly, resulting in error:

Error CS1577: The assembly generation failed - the quoted assembly "MyTypes" has no strong name

Check if the compiler error numbered CS1577 in MSDN shows the following information:

Computer set generation failed - reasons

Compiled assembly generation part failed. For more information, see the Error Document of the ALINK Utility (Al.exe).

Then then view the Al.EXE tool error and warning, find the following information:

The AL1055 referenced "FileName" does not have a strong name where you want to generate a set of strong names and reference to an assembly without a strong name, this error will happen. If the assembly has a strong name, it can be installed into the global assembly cache. Therefore, the quoted assembly needs to enter the global assembly cache. Only assemblies with strong names can enter the global assembly cache.

This shows that strong name assembly can only reference a strong name assembly.

转载请注明原文地址:https://www.9cbs.com/read-38508.html

New Post(0)