无法将我的应用程序连接到云 [英] Can't connect my app to the cloud

查看:101
本文介绍了无法将我的应用程序连接到云的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用vb.net(webrole)创建了一个应用.

我希望该应用使用我位于云中的数据库,它的名称是sgs,并且也希望我的Web安全设置(asp.net配置数据库)也位于云中.

(我不想使用安装在计算机上的SQL Server)

我已经阅读了有关此问题的几篇论文.

他们说我需要创建数据库,已经完成,并且需要创建第二个数据库来存储用户信息.

第二个数据库也已经在云中.我已经使用aspnet_regsql工具对其进行了配置.

因此,我有一个名为SGS的数据库,以及我通过工具aspnet_regsql创建和填充的其他数据库.第二个数据库名为segurancas.

创建数据库后,我读到有必要安装Nuget软件包库,然后完成了.

然后,您是否可以通过我的web.config文件看到我更改了连接字符串,以便它们直接连接到云.

ApplicationServices指向segurancas数据库
以及与我的SGS数据库的默认连接.

仍然无法使用asp.net配置来配置安全性.

我不断收到一条消息,说我的提供者不好.

你能帮忙吗?




WebConfig文件:

Hi, I have created an app using vb.net (webrole).

I want that this app use my database that is on the cloud, it''s name is sgs, and want too, that my web security settings (asp.net configuration database) be on the cloud too.

( I don''t want to use SQL Server installed on my machine)

I have read several papers about this issue.

They say that I need to create my database, whitch is already made, and that I need to create a second database that will store the user information.

This second database is also in the cloud already. I have used the tool aspnet_regsql to configure it.

So, I have a database, with the name SGS, and other database that I created and populated through the tool aspnet_regsql. This second database was named segurancas.

After creating the database I read that It was necessary to install Nuget package library and I done it.

Then, was you can see through my web.config file I changed the connection strings so they connect directly to the cloud.

The ApplicationServices is pointing to the segurancas database
and the default connection to my SGS database.

Still I can not configure security using asp.net configuration.

I keep receiving a message that my provider is not good.

Can you please help?




WebConfig file:

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.diagnostics>
    <trace>
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
          <!--><filter type="" />-->
        </add>
      </listeners>
    </trace>
  </system.diagnostics>
  <connectionstrings>
    <!-- <add name="ApplicationServices" connectionstring="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providername="System.Data.SqlClient" />
    -->
    
    <add name="ApplicationServices" connectionstring="data soruce=mwjw08qhju.database.windows.net;initial catalog=segurancas;user id=pr;password=00yzw12ptag34_;encrypt=True;Trusted_Connection=false; multipleactiveresultsets=True" providername="System.Data.SqlClient" />
    <add name="aspnet_1db0ca8ec36d4ba1852e5e4ec9947660Entities" connectionstring="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;initial catalog=aspnet_1db0ca8ec36d4ba1852e5e4ec9947660;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providername="System.Data.EntityClient" />
    <add name="SGSEntities" connectionstring="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=mwjw08qhju.database.windows.net;initial catalog=SGS;user id=pr;password=00yzw12ptag34_;encrypt=True;multipleactiveresultsets=True;App=EntityFramework"" providername="System.Data.EntityClient" />
    <add name="DefaultConnection" connectionstring="Data Source=Server=tcp:mwjw08qhju.database.windows.net,1433;Database=SGS;User ID=pr@mwjw08qhju;Password=myPassword;Trusted_Connection=False;Encrypt=True;multipleactiveresultsets=True" providername="System.Data.SqlClient  " />
  
  </connectionstrings>
  <system.web>
    <authorization>
      <allow roles="Administrador" />
      <deny users="?" />
    </authorization>
    <compilation debug="true" strict="false" explicit="true" targetframework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/login.aspx" timeout="2880" />
    </authentication>
    <membership defaultprovider="DefaultMembershipProvider">
      <providers>
        <clear />
        <add connectionstringname="ApplicationServices" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" requiresuniqueemail="false" maxinvalidpasswordattempts="5" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordattemptwindow="10" applicationname="/" name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" />
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionstringname="DefaultConnection" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" requiresuniqueemail="false" maxinvalidpasswordattempts="5" minrequiredpasswordlength="6" minrequirednonalphanumericcharacters="0" passwordattemptwindow="10" applicationname="/" />
      </providers>
    </membership>
    <profile defaultprovider="DefaultProfileProvider">
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionstringname="ApplicationServices" applicationname="/" />
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionstringname="DefaultConnection" applicationname="/" />
      </providers>
    </profile>
    <rolemanager enabled="true" defaultprovider="DefaultRoleProvider">
      <providers>
        <clear />

        
        
        <add connectionstringname="ApplicationServices" applicationname="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
        <add applicationname="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
        <add connectionstringname="DefaultConnection" applicationname="/" name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider,            System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
       <!--name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      -->
      </providers>
    </rolemanager>
    <sessionstate mode="InProc" customprovider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionstringname="DefaultConnection" applicationname="/" />
      </providers>
    </sessionstate>
  </system.web>
  <system.webserver>
    <modules runallmanagedmodulesforallrequests="true" />
  </system.webserver>
</configuration>





推荐答案

您好!
您的帖子来自相关搜索,我想尝试一下,看看是否可以提供帮助.我不知道您要连接到哪个云服务或您的连接字符串是什么,因此我只能尝试一些一般性建议,希望可以对问题有所启发...
我发现了非常相似的情况在Stackoverflow上:有人编写了一个vb.net/webrole应用程序,并试图将其连接到SQL Azure(同样,不确定要连接到哪个云).他也有一些问题,但是没有提到提供者错误.首先,也许看看他的配置会有所帮助.其次,给了他提示以设置防火墙规则以使其能够正确连接以及一些基于云的数据库(我认为它们支持asp.net应用程序),并且我还会检查Azure是否提供了一些一种前端或至少一个透明的上传过程.
因此,总而言之,我希望如果您对此有所遗忘,仍然对该应用程序情有独钟(并且会发现对您有所帮助).如果没有,我希望其他人会:D
Hi there!
Your post came up in a related search and I thought I’d give it a try and see if I can help. I don’t know which cloud service you’re trying to connect to or what your connection string is, so I can only try some general advice, which will hopefully shed some light on the issue...
I found a very similar scenario on Stackoverflow: someone wrote a vb.net/webrole app and is trying to connect it to SQL Azure (again, not sure which cloud you are connecting to). He too was having some problems, but did not mention a Provider error. First of all, maybe a look at his configuration will help. Second, he was given a tip to set up a firewall rule to be able to connect properly and some best practices, however, the latter apply only to SQL Azure.
Anyway, I see what you mean by "I don''t want to use SQL Server installed on my machine", yet "Still I can not configure/keep receiving a message...". What I mean is, getting this so-called simple task done tends to get complicated and timely. My best bet is you let this one go just because you never had the time to unravel the web of errors. I came across this thread because I was reading up on the subject of moving an app to the cloud, and I find it’s even more complex than I thought it to be. However, taking a slightly different approach, I understand there are managed services for mirroring your db and simply connecting your app to it (not all are paid). Here’s one type of cloud-based database I came across (I think they support asp.net apps), and I would also check if Azure offer some sort of front-end or at least a transparent upload procedure.
So to conclude, I hope that if you forgot about this you still have a soft spot for this app (and you’ll find it helpful). If not, I hope someone else will :D


这篇关于无法将我的应用程序连接到云的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆