{"action":"created","issue":{"url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/380","labels_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/380/labels{/name}","comments_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/380/comments","events_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/380/events","html_url":"https://github.com/domaindrivendev/Swashbuckle/issues/380","id":86654155,"number":380,"title":"Azure Web Role recycles when Swashbuckle.Core reference is present","user":{"login":"dendle","id":3049643,"avatar_url":"https://avatars.githubusercontent.com/u/3049643?v=3","gravatar_id":"","url":"https://api.github.com/users/dendle","html_url":"https://github.com/dendle","followers_url":"https://api.github.com/users/dendle/followers","following_url":"https://api.github.com/users/dendle/following{/other_user}","gists_url":"https://api.github.com/users/dendle/gists{/gist_id}","starred_url":"https://api.github.com/users/dendle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dendle/subscriptions","organizations_url":"https://api.github.com/users/dendle/orgs","repos_url":"https://api.github.com/users/dendle/repos","events_url":"https://api.github.com/users/dendle/events{/privacy}","received_events_url":"https://api.github.com/users/dendle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-09T16:18:45Z","updated_at":"2015-06-10T09:04:34Z","closed_at":null,"body":"Hello All,\r\n\r\nI am using Swashbuckle in a WebAPI project, and everything works perfectly in IIS locally.\r\n\r\nIt Also works fine when I run in from within IISExpress.\r\n\r\nAs soon as I send it to azure the role keeps recycling. The error code I get is that the role exited with error code 0.  If I remote into the machine, the AppPool just dies during startup.  Nothing in the event log.\r\n\r\nThe normal cause of role recycling is missing references, but this is not the case - If I extract the web app  from the package file, and point IIS at it, it again, works perfectly.  I also see the Swashbuckle assembly in the package.\r\n\r\nIf I create a brand new WebAPI project, it works fine.  It seems as if it doesn't play well with the existing WebAPI project for some reason.\r\n\r\nIts rather a large one, and I am currently ruling out interaction with other nugget packages, by slowly removing each one and seeing if the problem goes away.  No luck yet.\r\n\r\nHas anyone else experienced this issue?  Can anyone think of a reason why this might happen??\r\n\r\nThanks for any help in advance, and I will post my results of the nuget package elimination shortly.\r\n\r\nThanks,\r\nMatt"},"comment":{"url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/comments/110662161","html_url":"https://github.com/domaindrivendev/Swashbuckle/issues/380#issuecomment-110662161","issue_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/380","id":110662161,"user":{"login":"dendle","id":3049643,"avatar_url":"https://avatars.githubusercontent.com/u/3049643?v=3","gravatar_id":"","url":"https://api.github.com/users/dendle","html_url":"https://github.com/dendle","followers_url":"https://api.github.com/users/dendle/followers","following_url":"https://api.github.com/users/dendle/following{/other_user}","gists_url":"https://api.github.com/users/dendle/gists{/gist_id}","starred_url":"https://api.github.com/users/dendle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dendle/subscriptions","organizations_url":"https://api.github.com/users/dendle/orgs","repos_url":"https://api.github.com/users/dendle/repos","events_url":"https://api.github.com/users/dendle/events{/privacy}","received_events_url":"https://api.github.com/users/dendle/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T09:04:34Z","updated_at":"2015-06-10T09:04:34Z","body":"Confirmed!\r\n\r\nHere is what I had:\r\n    public class WebRoleEntryPoint : RoleEntryPoint\r\n    {\r\n        private static volatile bool _configuredIIS;\r\n        public override bool OnStart()\r\n        {\r\n            RoleEnvironment.StatusCheck += RoleEnvironment_StatusCheck;\r\n            return base.OnStart();\r\n        }\r\n\r\n        void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)\r\n        {\r\n            if (e.Status == RoleInstanceStatus.Ready && !_configuredIIS)\r\n            {\r\n                lock (typeof(WebRoleEntryPoint))\r\n                {\r\n                    LogEvent(String.Format(\"{0} IIS Configuraion Starting...\", DateTime.UtcNow));\r\n                    ConfigureIIS();\r\n                    _configuredIIS = true;\r\n                    LogEvent(String.Format(\"{0} IIS Configuration Complete\", DateTime.UtcNow));\r\n                }\r\n            }\r\n        }\r\n\r\n        private void ConfigureIIS()\r\n        {\r\n            ServerManager iis = new ServerManager();\r\n            foreach (Microsoft.Web.Administration.Site site in iis.Sites)\r\n            {\r\n                foreach (var application in site.Applications)\r\n                {\r\n                    application.SetAttributeValue(\"preloadEnabled\", true);\r\n                }\r\n                site.ApplicationDefaults.SetAttributeValue(\"preloadEnabled\", true);\r\n                site.ServerAutoStart = true;\r\n            }\r\n            foreach (ApplicationPool applicationPool in iis.ApplicationPools)\r\n            {\r\n                if (!applicationPool.Recycling.PeriodicRestart.Schedule.Any())\r\n                {\r\n                    applicationPool.Recycling.PeriodicRestart.Schedule.Add(new TimeSpan(3, 0, 0));\r\n                }\r\n            }\r\n            iis.CommitChanges();\r\n        }\r\n\r\n        private void LogEvent(string message)\r\n        {\r\n            const string sSource = \"MyApiSource\";\r\n            const string sLog = \"Application\";\r\n            string sEvent = message;\r\n\r\n            if (!EventLog.SourceExists(sSource))\r\n            {\r\n                EventLog.CreateEventSource(sSource, sLog);\r\n            }\r\n            EventLog.WriteEntry(sSource, sEvent, EventLogEntryType.Information);\r\n        }\r\n    }\r\n\r\nIf I comment that out, everything works.\r\n\r\nI'm narrowing things down now by slowly adding stuff till it breaks again.\r\n\r\nCheers,\r\nMatt"}}