【问题标题】:Trying to learn Azure but sample project fails. How to get it to build/run?尝试学习 Azure 但示例项目失败。如何让它构建/运行?
【发布时间】:2014-12-05 05:59:21
【问题描述】:

我正在尝试运行位于此处的 PhluffyFotos 示例项目:https://code.msdn.microsoft.com/PhluffyFotos-Sample-7ecffd31?SRC=VSIDE

  • 我已经从那个链接下载了它
  • 我还尝试从 File|New|Project|Online|Samples|Visual c#|Cloud|Microsoft Azure 打开以加载示例。

  • 我按照指定安装了 VS 2012 Pro、SQL Server Express 和 Azure SDK 1.7,但运行时出现空错误(Microsoft.WindowsAzure.ServiceRuntime 是错误所在,但我找不到PDB 文件以获取源信息)以及状态文件和包配置上的错误。

  • 我将 Azure SDK 升级到 2.5,但同样的错误。 C:\Program Files\Microsoft SDKs\Azure.NET SDK\v2.5\ref\Microsoft.WindowsAzure.ServiceRuntime.dll 在 worker 的引用中列出。

  • 我卸载了所有这些,并在 VS2013 上使用 LocalDB 和 Azure SDK 2.5 进行了尝试,得到了同样的错误。

  • 我在 VS2013、SQL Server Express 和 Azure SDK 2.5 上进行了尝试,得到了同样的错误。这些是错误:

    Warning 1   Could not read state file "obj\Debug\PhluffyFotos.Data.WindowsAzure.csprojResolveAssemblyReference.cache". Exception has been thrown by the target of an invocation.    PhluffyFotos.Data.WindowsAzure
    
    Warning 2   Could not read state file "obj\Debug\PhluffyFotos.Worker.csprojResolveAssemblyReference.cache". Exception has been thrown by the target of an invocation.   PhluffyFotos.Worker
    
    Error   3   Failed to download package correctly. The contents of the package could not be verified.    PhluffyFotos.Web
    
    Error   4   The command ""c:\users\me\documents\Visual Studio 2013\Projects\PhluffyFotos Sample1\.nuget\nuget.exe" install "c:\users\me\documents\Visual Studio 2013\Projects\PhluffyFotos Sample1\PhluffyFotos.Web\packages.config" -source "" -o "c:\users\me\documents\Visual Studio 2013\Projects\PhluffyFotos Sample1\packages"" exited with code 1.   PhluffyFotos.Web
    

这应该在本地运行,并在将连接字符串设置为在那里创建的服务后在 Azure 上运行。我无法让它在本地运行。我怎样才能让这个示例快乐并让它运行?

【问题讨论】:

  • 我已经更新了我的答案

标签: c# sql-server azure


【解决方案1】:

我会尝试,以管理员身份运行 VS 清理您的解决方案 再次重建

更新

好的,我下载了项目,还有其他一些问题会出错

  • 右击解决方案,点击“管理解决方案的nuget包”

  • 恢复任何丢失的包,如果有丢失的包,顶部通常会显示一个黄色条,用恢复按钮说明问题

  • 您必须在 web 项目中更改您的 Web.Config 文件,找到以下内容

<configuration>
  <connectionStrings>
     <add name="DataConnectionString" connectionString="DefaultEndpointsProtocol=https;AccountName={YOUR-ACCOUNT};AccountKey={YOUR-ACCOUNT-KEY}" />
  • 使用从 azure 门户获得的 azure 存储帐户信息更新 YOUR-ACCOUNT 和 {YOUR-ACCOUNT-KEY}

【讨论】:

  • 消除了警告。我已经以管理员身份运行,但清理帮助了一些人。不过,我仍然有 null 和包问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-01-29
  • 1970-01-01
  • 2017-10-17
  • 2022-08-10
  • 2016-05-21
  • 1970-01-01
  • 2021-11-15
相关资源
最近更新 更多