本文整理匯總了C#中Microsoft.WindowsAzure.Commands.Utilities.CloudService.CloudServiceProject.GenerateScaffolding方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudServiceProject.GenerateScaffolding方法的具體用法?C# CloudServiceProject.GenerateScaffolding怎麽用?C# CloudServiceProject.GenerateScaffolding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.WindowsAzure.Commands.Utilities.CloudService.CloudServiceProject
的用法示例。
在下文中一共展示了CloudServiceProject.GenerateScaffolding方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CacheClientCommonConfiguration
private static void CacheClientCommonConfiguration(
CloudServiceProject cloudServiceProject,
string roleName,
bool isWebRole,
string cacheWorkerRole,
Startup startup,
Endpoints endpoints,
LocalResources localResources,
ref DefinitionConfigurationSetting[] configurationSettings)
{
if (isWebRole)
{
// Generate cache scaffolding for web role
cloudServiceProject.GenerateScaffolding(Path.Combine(Resources.CacheScaffolding, RoleType.WebRole.ToString()),
roleName, new Dictionary<string, object>());
// Adjust web.config to enable auto discovery for the caching role.
string webCloudConfigPath = Path.Combine(cloudServiceProject.Paths.RootPath, roleName, Resources.WebCloudConfig);
string webConfigPath = Path.Combine(cloudServiceProject.Paths.RootPath, roleName, Resources.WebConfigTemplateFileName);
UpdateWebConfig(roleName, cacheWorkerRole, webCloudConfigPath);
UpdateWebConfig(roleName, cacheWorkerRole, webConfigPath);
}
else
{
// Generate cache scaffolding for worker role
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters[ScaffoldParams.RoleName] = cacheWorkerRole;
cloudServiceProject.GenerateScaffolding(Path.Combine(Resources.CacheScaffolding, RoleType.WorkerRole.ToString()),
roleName, parameters);
}
// Add default memcache internal endpoint.
InternalEndpoint memcacheEndpoint = new InternalEndpoint
{
name = Resources.MemcacheEndpointName,
protocol = InternalProtocol.tcp,
port = Resources.MemcacheEndpointPort
};
endpoints.InternalEndpoint = GeneralUtilities.ExtendArray<InternalEndpoint>(endpoints.InternalEndpoint, memcacheEndpoint);
// Enable cache diagnostic
LocalStore localStore = new LocalStore
{
name = Resources.CacheDiagnosticStoreName,
cleanOnRoleRecycle = false
};
localResources.LocalStorage = GeneralUtilities.ExtendArray<LocalStore>(localResources.LocalStorage, localStore);
DefinitionConfigurationSetting diagnosticLevel = new DefinitionConfigurationSetting { name = Resources.CacheClientDiagnosticLevelAssemblyName };
configurationSettings = GeneralUtilities.ExtendArray<DefinitionConfigurationSetting>(configurationSettings, diagnosticLevel);
// Add ClientDiagnosticLevel setting to service configuration.
AddClientDiagnosticLevelToConfig(cloudServiceProject.Components.GetCloudConfigRole(roleName));
AddClientDiagnosticLevelToConfig(cloudServiceProject.Components.GetLocalConfigRole(roleName));
}