在AWS Elastic Beanstalk(IIS)上启用gzip会引发错误

时间:2016-04-16 11:22:43

标签: amazon-web-services elastic-beanstalk

我正在尝试在AWS Elastic Beanstalk上的IIS上启用gzip,我发现了这个link。但是,当我按照链接中提到的步骤时,我收到以下错误。

这是来自日志文件:

Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'c:\staging\archive.xml'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
   at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
   at System.Xml.XmlTextReaderImpl.FinishInitUriString()
   at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
   at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
   at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at AWSBeanstalkCfnDeploy.DeploymentUtils.getAppPath() in d:\Jenkins\jobs\build-EBDPT-IISCore-V1\workspace\AWSBeanstalkCfnDeploy\DeploymentUtils.cs:line 304
   at AWSBeanstalkCfnDeploy.DeploymentUtils.ContainerConfigDefaults(String appBundle, String appBundleFinal, String containerConfig) in d:\Jenkins\jobs\build-EBDPT-IISCore-V1\workspace\AWSBeanstalkCfnDeploy\DeploymentUtils.cs:line 297
   at AWSBeanstalkCfnContainerDefaultsApp.Program.Main(String[] args) in d:\Jenkins\jobs\build-EBDPT-IISCore-V1\workspace\AWSBeanstalkCfnContainerDefaultsApp\Program.cs:line 19

如果你知道为什么会这样,请告诉我。

1 个答案:

答案 0 :(得分:0)

尝试使用AWS Elastic Beanstalk部署ASP.NET Web应用程序时遇到了同样的错误,我想我已经弄明白了。

部署.zip时,EB部署工具会将内容提取到c:\ staging,然后在.ebextensions文件夹中运行配置文件。在此期间,EB部署工具似乎正在寻找一个通常包含在MS Web-Deploy软件包zip中的archive.xml文件 - 通常在根级别包含此文件和其他文件:

Content/
archive.xml
parameters.xml
systemInfo.xml

我正在部署的zip文件未使用MS Web-Deploy打包,因此未包含这些文件。我已经更新了我的构建过程以使用web-deploy打包我的Web应用程序:

msbuild MyWebApplication.csproj /T:Package