标签: windows-runtime

Winsxs文件夹(Windows运行时程序集目录)中的文件夹名称的含义是什么

背景:

  • Windows 共享运行时库位于C:\windows\Winsxs文件夹
  • 在 Winsxs 内部,有两个重要的子文件夹也位于policiesManifests
  • 除此之外,还有大量的运行时程序集位于彼此的子文件夹中。
  • 里面的所有子文件夹都Winsxs具有 policies 相同的命名格式。

例如文件夹名称:

  • 运行时间:x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e
  • 政策:x86_policy.9.0.Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_x-ww_b7353f75

据我所知,名称的第一部分(x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1)描述了程序集或策略的“processorArchitecture”( x86),“Name”(Microsoft.VC90.CRT),“publicKeyToken”(1fc8b3b9a1e18e3b)和“Version”( )。9.0.30729.1

问题: assembly( x-ww_6f74963e) 或policy( x-ww_b7353f75) 文件夹名称的最后一部分描述了什么?


好的,这是原始问题(但故事很长)。我在 Windows XP 计算机上部署了 C++ MFC 应用程序,该计算机先前安装了一些 C++ 重新分发包和一些运行时程序集的安全补丁。因此,这些预安装的 C++ 重新分发包会自动在Winsxs/policies. 这些策略强制使用新的运行时程序集,而不是我的应用程序使用和部署的程序集。但有时,由于某些其他应用程序删除或程序集可能损坏,这些较新的 DLL 不存在。因此,我正在寻找一种方法来部署专门用于我的应用程序的运行时程序集(这意味着我的应用程序必须使用它部署的一次程序集并忽略策略)。所以我认为子目录名称的最后一部分与应用程序的身份相关联。我需要找到它。

windows winsxs windows-runtime

2
推荐指数
1
解决办法
2325
查看次数

如何在 Windows 应用商店应用程序中将 HTML 颜色名称解析为 SolidColorBrush

在 .NET 中,有一个类可以将文本 HTML 颜色名称转换为颜色(在本例中为“红色”):

Color col=(Color)ColorConverter.ConvertFromString("Red"); 
Brush brush=new SolidColorBrush(col);
Run Code Online (Sandbox Code Playgroud)

(我从这里获取:Cast Color Name to SolidColorBrush

这几乎适用于维基百科上可以找到的所有颜色

是否有一个等效的类/库Windows Store Apps可以做同样的事情?

c# xaml windows-runtime windows-store-apps

2
推荐指数
1
解决办法
864
查看次数

处理在 xaml 中创建的控件

如何在 WinRT 中处置由 XAML 代码创建的控件?我创建了ImageSlideShow使用SempahoreSlimand DispatcherTimer(我使用timer.Tick事件)的UserControl。我应该将 .Unloaded 事件处理程序添加到ImageSlideShow用户控件或实现 IDisposable (xaml 是否负责调用 .Dispose?)以释放资源和事件处理程序 - 或者我是否需要像在代码隐藏中创建的控件一样手动处理它?

c# xaml windows-runtime

2
推荐指数
1
解决办法
3282
查看次数

从Powershell调用WinRT Async方法在win8中设置帐户图片

我正在尝试将一些东西放在一起,以使用 AD 缩略图照片在 Windows 8 上设置用户的帐户图片。看来我应该能够使用 WinRT 的 API 来执行此操作。我从各种来源拼凑了一些有关从 powershell 调用 API 的信息,但我无法让它工作。这是我尝试做的一个例子:

\n
$photo = ([ADSISEARCHER]\xe2\x80\x9csamaccountname=$($username)\xe2\x80\x9d).findone().properties.thumbnailphoto\n$path = "C:\\temp\\Photo.jpg"\n$photo | set-content $path -encoding byte\n\n\n[Windows.System.UserProfile.UserInformation,Windows.System.UserProfile,ContentType=WindowsRuntime] > $null\n[Windows.System.UserProfile.UserInformation]::SetAccountPictureAsync($photo)\n
Run Code Online (Sandbox Code Playgroud)\n

我尝试了其他一些变体,但无论我做什么,我最终都会遇到这样的错误:

\n
Cannot convert argument "image", with value: "System.Object[]", for "setAccountPictureAsync" to type "Windows.Storage.IStorageFile" . . . \n
Run Code Online (Sandbox Code Playgroud)\n

我是否缺少一些简单的东西来完成这项工作?

\n

我发现Keith Hill 的这篇博文似乎可能有帮助,但我不确定它是否直接转化为我遇到的问题。

\n

谢谢!

\n

奥罗克

\n

c# powershell windows-8 windows-runtime

2
推荐指数
1
解决办法
2092
查看次数

BitmapImage ImageOpened 事件未触发

为什么在此示例中未触发 ImageOpened 事件?我在 Win8 的 WinRT 应用程序中使用它。

BitmapImage myImage = new BitmapImage();        
myImage.ImageOpened += myImage_ImageOpened;
myImage.UriSource = new Uri("ms-appx:/Assets/Image.png");


private void myImage_ImageOpened(object sender, RoutedEventArgs e)
{
    int pixelHeight = (sender as BitmapImage).PixelHeight;
}
Run Code Online (Sandbox Code Playgroud)

我的问题是 ImageOpened 事件没有被触发。我想检查图像的 PixelHeight 和 PixelWidth,但如果没有收到此事件,则无法检查。

c# events bitmapimage windows-runtime

2
推荐指数
1
解决办法
1513
查看次数

包含正则表达式分隔符的简单且经过测试的在线正则表达式在 C# 代码中不起作用

我有一个这样的正则表达式:

name = dr-det-fb.ydp.eu/ebook/trunk/annotations/ctrl.php/api1751-4060-1193-0487
name = Regex.Replace(name, @"/\W/g", "");
Run Code Online (Sandbox Code Playgroud)

此正则表达式应替换“/”、“-”、“。” 和 ””。但它没有,有人可以解释我为什么吗?

c# regex windows-runtime

2
推荐指数
1
解决办法
1028
查看次数

“winmdexp.exe”退出,代码为-532462766

场景:Visual Studio 2013 Ultimate 版本 4。Windows 8.1 通用项目。C#。我需要一个 Windows 运行时组件来定期更新我的动态磁贴。解决方案构建以错误消息结束:

“winmdexp.exe”退出,代码为-532462766

在过去的 2-1/2 天里我一直在寻找线索。没有什么比这更接近的了。此解决方案中的三个项目中的任何代码都没有语法错误。至少有人能给我指出一个方向吗?

c# windows-runtime windows-phone-8.1

2
推荐指数
1
解决办法
2311
查看次数

用于 ListView 的 DataTemplate 中的行分隔符

我有 ItemsControl,每个项目都有可绑定的 itemsource 和自定义 datetemplate。项目由行分隔。但是最后一项也有分隔符,这就是我的问题,如何不为最后一项渲染行。我找到了这个解决方案,但它在 WPF 中有效:

如何在 ItemsControl 中的项目之间添加分隔符

编辑: 这是我的模板:

<ItemsControl Grid.Row="1"  ItemsSource="{x:Bind ViewModel.AvailableStatuses}" x:Name="Statuses">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical" Padding="60,0,60,12"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid Background="Transparent">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <i:Interaction.Behaviors>
                                    <core:EventTriggerBehavior EventName="Tapped">
                                        <core:InvokeCommandAction Command="{Binding ElementName=ContentGrid, Path=DataContext.ChangeStatusCommand}" CommandParameter="{Binding}"/>
                                    </core:EventTriggerBehavior>
                                </i:Interaction.Behaviors>
                                <Rectangle StrokeThickness="0.4" Height="0.4" x:Name="Separator" 
                                   VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Stroke="#D1D3D4" />
                                <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Stretch">
                                    <Image Source="{Binding Converter={StaticResource SelectContactStatusConverter}}" Margin="0,8,12,8"/>
                                    <TextBlock Text="{Binding Converter={StaticResource EnumContactStatusToTextConverter}}" FontSize="20" VerticalAlignment="Center" Foreground="Black"/>
                                </StackPanel>
                            </Grid>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
Run Code Online (Sandbox Code Playgroud)

xaml windows-runtime winrt-xaml uwp uwp-xaml

2
推荐指数
1
解决办法
3194
查看次数

COM 和 WinRT 之间的关系

我没有清楚地了解COM(组件对象模型)和WinRT(Windows 运行时)之间的相似/差异或关系本身。

根据我的理解,它们都是为了提供“运行时引擎”来使组件能够进行通信......这是 CLR(公共语言运行时)吗?

WinRT 随 Windows 8 一起出现,为多种语言提供了一个通用平台。

我不明白的是,WinRT 是否取代了 COM?它们是一样的吗?

.net c# com windows-runtime

2
推荐指数
1
解决办法
803
查看次数

库包含 WinRT 损坏

我正在尝试编译这个项目:https ://github.com/bucienator/ble-win-cpp

克隆存储库后,我收到错误“wait_for”不是“winrt :: impl”的成员。使用 NuGet,我将 Microsoft.Windows.CppWinRT 包添加到项目中。但之后我对所有库的导入都中断了:

#include <winrt / Windows.Foundation.h>
#include <winrt / Windows.Devices.Bluetooth.h>
#include <winrt / Windows.Devices.Enumeration.h>
#include <winrt / Windows.Devices.Bluetooth.Advertisement.h>
#include <winrt / Windows.Devices.Bluetooth.GenericAttributeProfile.h>
#include <winrt / Windows.Storage.Streams.h>
Run Code Online (Sandbox Code Playgroud)

告诉我如何让 Visual Studio 编译我的项目?

c++ windows-runtime cppwinrt

2
推荐指数
1
解决办法
1951
查看次数