部署时,WindowsAPICodePack属性为null

时间:2014-11-04 12:01:46

标签: c# asp.net-mvc windows-api-code-pack

在本地调试时,我可以从.mp4视频中读取标题。

但是,在将此应用程序部署到IIS后,Title属性为null。

为什么会发生这种情况?

foreach (var f in new DirectoryInfo(videosLocation).GetFiles()
                            .Where(x => x.FullName.EndsWith(".mp4", StringComparison.CurrentCultureIgnoreCase))
                            .ToList())
        {
            using (var so = ShellObject.FromParsingName(f.FullName))
            {
                var titleProp = so.Properties.GetProperty(SystemProperties.System.Title).ValueAsObject;
                var title = titleProp == null ? "no title" : titleProp.ToString();
                // title is null when deployed
            }
        }

0 个答案:

没有答案