Why are some Azure-specific assemblies not present on Azure instances?

走远了吗. 提交于 2019-12-13 14:43:24

问题


An Azure role will likely need a set of Azure-specific .NET assemblies like Microsoft.WindowsAzure.ServiceRuntime and Microsoft.WindowsAzure.StorageClient. Turns out the latter is not in the GAC on Azure instances and so I have to set "Copy Local" to "True" in the Visual Studio project so that it gets into the service package and deployed to Azure. If I don't do that the assembly is not there and the missing dependency will prevent my role from starting.

This doesn't make any sense to me. Either it's just a bug or I don't get the big picture.

Is there a good reason why the key assemblies would not be present in Azure instances GAC and I have to carry them with my service package?


回答1:


These key Azure assemblies aren't a part of the .NET Framework - that's why they are not in the GAC. Maybe in the future they will be added to the .NET Framework.

Azure is not dedicated to running only .NET code. People use it for other platforms such as Java, PHP, node.js, python, etc. It wouldn't make sense to add assemblies that are specific to .NET Azure implementations in the VM Role Instances.

Yes - this was also an annoyance when I first started on Azure, but the same is true if you would have published this on-premise to a machine without the Azure SDK.




回答2:


Is there a good reason why the key assemblies would not be present in Azure instances GAC and I have to carry them with my service package?

I would like to point out that not every project needs to work with storage, so it makes sense the storage assembly is not pre-installed. One less assembly to load, a tiny performance improvement you get. But every project need to be integrated with Windows Azure runtime. So runtime assemblies are pre-installed. From my experience, by default when we create a Windows Azure web/worker role, the storage assembly reference automatically has copy local set to true. Thus, we don’t need to do extra tasks to make it work.

Best Regards,

Ming Xu.



来源:https://stackoverflow.com/questions/10722886/why-are-some-azure-specific-assemblies-not-present-on-azure-instances

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!