Я не знаком с Mac OS Виджеты Dashcode, но если бы они позволяют Вам пользоваться библиотеками JavaScript и поддерживать XMLHttpRequests, я использовал бы jQuery и сделал бы что-то вроде этого:
var page_content;
$.get( "somepage.php", function(data){
page_content = data;
});
The AssemblyVersionAttribute
is not added to the assembly, but is treated in a "special" way by the compiler (i.e. it sets the version of the assembly)
You CAN get the AssemblyFileVersion
attribute (i.e. this one is added to the assembly)
There are other attributes that show the same behavior: the AssemblyCultureAttribute
and AssemblyFlagsAttribute
are also used for setting assembly properties, and are not added to the assembly as custom attributes.
All of these attributes are listed under the Assembly Identity Attributes in the documentation. The documentation says this about these attributes:
Three attributes, together with a strong name (if applicable), determine the identity of an assembly: name, version, and culture.
Ваш пример не является временным решением. Это именно то, что вам следует делать в документации MSDN, что наводит меня на мысль, что код создан специально.
http://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx
Чтобы получить имя [sic] загруженной сборки, вызовите
GetName
в сборке, чтобы получитьAssemblyName
, а затем получите свойствоVersion
. . Чтобы получить имя сборки, которую вы не загрузили, вызовитеGetAssemblyName
из клиентского приложения, чтобы проверить версию сборки, которую использует ваше приложение.
Не знаю, почему он так себя ведет. Вместо того, чтобы идти после AssemblyVersionAttribute, мы делаем следующее:
Version AssemblyVersion = someAssembly.GetName().Version;
Для AssemblyFileVersion мы используем:
Version fileVersion = new Version("0.0.0.0");
AssemblyFileVersionAttribute[] fileVersionAttributes = (AssemblyFileVersionAttribute[])assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true);
if (fileVersionAttributes != null && fileVersionAttributes.Length > 0) {
fileVersion = new Version(fileVersionAttributes[0].Version);
}