我已经有一个已经存在的.NET MVC2应用程序,因为我们每天浪费80Gb的带宽,我想把它放在云中,以便更加可扩展廉价
如果我们在欧洲,我一直在寻找并且几乎没有替代Azure ,但我已经在Azure上拥有700小时的帐户。
因为我在尝试使用证书时总是遇到错误(即使使用正确的凭据也无法获取云上的现有证书)我编译成一个包并上传为生产
从来没有工作过!,然后我删除了一个并单独上传了“前端”,我得到了我不习惯的相同内容,我不知道该怎么做
现在差不多4个小时就是这样:
我可以帮忙解决这个问题吗?我没有人可以求助于你们在最艰难的编程时间里成为我最好的朋友。***
角色是默认角色
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
namespace BackendWebRole
{
public class WebRole : RoleEntryPoint
{
public override bool OnStart()
{
DiagnosticMonitor.Start("DiagnosticsConnectionString");
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
RoleEnvironment.Changing += RoleEnvironmentChanging;
return base.OnStart();
}
private void RoleEnvironmentChanging(object sender, RoleEnvironmentChangingEventArgs e)
{
// If a configuration setting is changing
if (e.Changes.Any(change => change is RoleEnvironmentConfigurationSettingChange))
{
// Set e.Cancel to true to restart this role instance
e.Cancel = true;
}
}
}
}
ServiceConfiguration.cscfg
<?xml version="1.0"?>
<ServiceConfiguration serviceName="CloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
<Role name="Julekalender (Frontend)">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" value="DefaultEndpointsProtocol=https;AccountName=julekal;AccountKey=xR4G1SIUTSHdvAE1IpRKPoxJRr1upJjBcdqRX2GWGkwlO6tbbu30Bikz/ApBzUKhRvk+XaozvE/NIAwDzKCg==" />
</ConfigurationSettings>
</Role>
<Role name="Julekalender (Backend)">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" value="DefaultEndpointsProtocol=https;AccountName=julekal;AccountKey=xR4G1SIUTSHdvAE1IpRKPoxJRr1upJjBcdqRX2GWGkwlO6tbbu30Bikz/ApBzUKhRvk+XaozvE/NIAwDzKCg==" />
</ConfigurationSettings>
<Certificates>
</Certificates>
</Role>
</ServiceConfiguration>
ServiceDefinition.csdef
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="CloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="Julekalender (Frontend)" vmsize="Medium">
<InputEndpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
</InputEndpoints>
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" />
</ConfigurationSettings>
</WebRole>
<WebRole name="Julekalender (Backend)">
<InputEndpoints>
<InputEndpoint name="HttpIn" protocol="http" port="8081" />
</InputEndpoints>
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" />
</ConfigurationSettings>
<Certificates>
</Certificates>
</WebRole>
</ServiceDefinition>
答案 0 :(得分:2)
如果您不使用Windows Azure MVC模板,则需要确保将相应的DLL标记为“copy local”(因为它们不存在于云中)。我相信这些是您需要执行此操作的DLL:
只需转到每个引用的属性,然后将“copy local”设置为“always。”
答案 1 :(得分:0)
您是否偶然遗漏了角色中的WebRole.cs和WebWorker.cs文件?如果它们是由Visual Studio创建的,那么它们是否指向有效的非Dev-Storage帐户?
我不知道v1.3 SDK中的新设置,但是在v1.2 SDK中,它在CloudService项目的ServiceConfiguration.cscfg文件中称为DiagnosticsConnectionString
如果两者都结账,请发布您的WebRole和WorkerRole文件?