.NET:Assembly.CodeBase vs. Assembly.Location

The CodeBase is a URL to the place where the file was found, while the Location is the path from where it was actually loaded. For example, if the assembly was downloaded from the internet, its CodeBase may start with "http://", but its Location may start with "C:\". If the file was shadow copied, the Location would be the path to the copy of the file in the shadow-copy dir.

It’s also good to know that the CodeBase is not guaranteed to be set for assemblies in the GAC. Location will always be set for assemblies loaded from disk, however.

posted on 2014-03-05 22:17  幸福框架  阅读(1610)  评论(0编辑  收藏  举报

导航

我要啦免费统计