相关疑难解决方法(0)

初始化字符串的格式不符合从索引0开始的规范

我有一个ASP.Net应用程序,它在我的本地开发机器上运行良好.

当我在线运行此应用程序时,它显示以下错误

初始化字符串的格式不符合从索引0开始的规范

c# asp.net sql-server-2008

120
推荐指数
4
解决办法
25万
查看次数

将ASP.NET部署到Windows Azure云,应用程序在云上运行时会出错

我正在尝试在Windows Azure云中部署ASP.NET应用程序.我正在为应用程序中的一个调用使用Google API.当我这样做时,我收到以下错误:

System.UnauthorizedAccessException:拒绝访问路径'Google.Apis.Auth'

ASP.NET无权访问所请求的资源.考虑将资源的访问权限授予ASP.NET请求标识.ASP.NET具有基本进程标识(IIS 5上通常为{MACHINE}\ASPNET,IIS 6和IIS 7上为网络服务,IIS 7.5上已配置的应用程序池标识),如果应用程序未模拟,则使用该标识.如果应用程序模拟通过,则标识将是匿名用户(通常为IUSR_MACHINENAME)或经过身份验证的请求用户.

要授予对文件的ASP.NET访问权限,请在"文件资源管理器"中右键单击该文件,选择"属性",然后选择"安全"选项卡.单击"添加"以添加适当的用户或组.突出显示ASP.NET帐户,并选中所需访问的框

我试过研究这个,但所有的建议都谈到了改变IIS服务器的设置,我不相信我有权访问,因为它在云中运行.有人可以帮忙吗?

编辑:这是给出错误的函数的代码:

 Async Function SpecialTest() As Task(Of String)

    Dim credential As UserCredential
    Dim clientSecretsPath As String = Server.MapPath("~/App_Data/client_secret.json")
    Dim scopes As IList(Of String) = New List(Of String)()
    scopes.Add(CalendarService.Scope.Calendar)
    Dim stream As FileStream = New FileStream(clientSecretsPath, System.IO.FileMode.Open, System.IO.FileAccess.Read)

    Using stream
        credential = Await GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets, scopes, "user3", CancellationToken.None)
    End Using


    Dim baseInitializer = New BaseClientService.Initializer()
    With baseInitializer
        .HttpClientInitializer = credential
        .ApplicationName = "P1"
    End With

    Dim service = New CalendarService(baseInitializer)


    Dim Calendars …
Run Code Online (Sandbox Code Playgroud)

vb.net asp.net iis azure google-api-dotnet-client

5
推荐指数
1
解决办法
3025
查看次数