我有一个在两个不同设备上工作的 UWP 应用程序。在最新的 Visual Studio 2019 更新后,我开始收到此错误:
未找到带有所提供指纹的证书:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
该应用程序以前具有用于自动生成它不再具有的临时密钥 Visual Studio。我根据此链接https://docs.microsoft.com/en-us/windows/msix/package/create-certificate-package-signing 上的说明生成了一个新的密钥文件,该文件 在我的桌面上运行。我能够在包清单中选择证书,更新 csproj 文件中的“PackageCertificateThumbprint”,然后构建和创建旁加载包。
现在,切换到我的笔记本电脑。即使我已将我创建的证书带到该机器上,我还是再次收到上述错误。包 GUI 告诉我没有可用的有效证书。我试过将该证书添加到本地机器无济于事。
这是一个个人项目,不是去商店的目的,但我确实需要开发两个盒子并为一组测试人员创建侧载包。
我正在尝试更改WinRT页面(XAML)上"ListBox"的背景颜色.当我使用"背景"属性时,它会在控件没有焦点时更改背景的方式.当它获得焦点时,它会变为白色,我无法弄清楚如何覆盖它.
我的问题是,如果强制选择/有焦点,如何强制ListBox的背景始终为灰色?
XAML#1:
<ListBox x:Name="ListBoxMenu" Background="LightGray" Grid.Row="0" Grid.Column="0" Margin="0,0,0,0">
<ListBoxItem>Menu Item 1</ListBoxItem>
<ListBoxItem>Menu Item 2</ListBoxItem>
<ListBoxItem>Menu Item 3</ListBoxItem>
</ListBox>
Run Code Online (Sandbox Code Playgroud)
XAML#2(每个项目也设置):
<ListBox x:Name="ListBoxMenu" Background="LightGray" Grid.Row="0" Grid.Column="0" Height="124" VerticalAlignment="Top">
<ListBoxItem Background="LightGray">Menu Item 1</ListBoxItem>
<ListBoxItem Background="LightGray">Menu Item 2</ListBoxItem>
<ListBoxItem Background="LightGray">Menu Item 3</ListBoxItem>
</ListBox>
Run Code Online (Sandbox Code Playgroud)


作为临时解决方案,我将ListBox设置为仅硬编码高度,然后使用该列上的边框用LightGray填充剩余的空间.我真的想总是在ListBox上设置背景颜色,这可能吗?
今天,我在 Visual Studio 中的 CPU 使用性能分析器停止工作。我启动它,它似乎正在工作,您可以看到 CPU 的图形上下波动,但是当它完成时,我没有收到带有消息的数据:
“当前过滤器集中没有数据。”
我尝试了所有类别和过滤器的组合,但都没有成功。我重新启动了 Visual Studio,重新启动了工作站,我尝试了一个新的 hello world 项目。其他性能工具似乎有效(例如 .NET 对象分配跟踪工具有效)。为了(尝试)排除它是我项目中的特定内容,我能够在第二台工作站上针对同一组代码成功运行它。在禁用我添加的所有内容(如 ReSharper)后,我还运行了不带扩展的 VS 并在常规模式下运行。
编辑:另外,我刚刚在 Windows 事件查看器中找到了这个。
System.Runtime.InteropServices.COMException: The method or operation is not implemented., System.Object get_Value()
at EnvDTE.Property.get_Value()
at Microsoft.VisualStudio.PerformanceTools.ProjectTarget.LoadBinaryProject(IVsHierarchy hier)
at Microsoft.VisualStudio.PerformanceTools.ProjectTarget.LoadProjInfo()
Run Code Online (Sandbox Code Playgroud)
这也刚刚在“Windows 错误报告”下的事件查看器中弹出,引用了 Watson VSTelem.Out 错误:
Fault bucket 125730739576, type 5
Event Name: PerfWatsonVS12Data
Response: Not available
Run Code Online (Sandbox Code Playgroud)
另一个奇怪的是,我只运行了大约 20 秒的配置文件会话,但是当它完成时,VS 说“诊断会话:127:47 分钟”,如果它从未停止过,这将是我今天早上第一次尝试的时间。我从安装程序中修复了 Visual Studio,并且配置文件在 1 个会话之后工作,然后第二个会话再次恢复到上述行为。
我目前正在使用:
我有一个 Python 脚本(在 2.7 上运行),当我从命令行和后台运行它时,它的行为会有所不同。当我从终端运行它时,它按预期运行,两个线程作为守护进程运行,将输出写入窗口,而主循环等待退出命令。它永远运行,直到我输入退出:
python test.py
Run Code Online (Sandbox Code Playgroud)
当同一个程序在后台运行时,两个线程都运行一次,然后程序挂起(我已经将范围缩小到 raw_input,我想我做出了一个错误的假设,即即使在background 和 raw_input 阻塞了主线程。例如,两个线程基本上会永远运行,因为在这种情况下没有输入)。
python test.py &
Run Code Online (Sandbox Code Playgroud)
我的目标是让一个程序运行这些循环(可能永远),但如果我从终端运行它会接受输入。
为了允许程序从终端/后台运行,我是否需要在 raw_input 之前放置一个 if 语句来检查它是否在后台或者我是否缺少其他有帮助的语句?
import sys
import time
from threading import Thread
def threadOne():
while True:
print("Thread 1")
time.sleep(1)
def threadTwo():
while True:
print("Thread 2")
time.sleep(1)
# Run the threads in the background as daemons
threadOne = Thread(target = threadOne)
threadOne.daemon = True
threadOne.start()
threadTwo = Thread(target = threadTwo)
threadTwo.daemon = True
threadTwo.start()
# Main input loop. This will allow us to enter …Run Code Online (Sandbox Code Playgroud) 我在WinRT项目中使用WriteableBitmapEx.我将图像加载到用户图片库的WriteableBitmap中.但是,我不能立即写入该图像,如果我这样做,它将被图像本身覆盖(看起来它是异步加载图像然后它覆盖我的绘图在它上面).我不知道如何阻止它(我尝试在SetSource上使用Await,但这不是Async方法).
我已经使用了"Await Task.Delay(1000)"并且有效,但它看起来很hacky因为1000ms可能或者可能没有足够的时间..我希望它等到位图加载后再继续.
任何人都可以看出我做错了什么或建议我如何确保在进行任何处理之前从图片库加载WriteableBitmap?这是我创建的示例代码段:
Dim file = Await picker.PickSingleFileAsync
If file Is Nothing Then
Exit Sub
End If
Dim wbm As New WriteableBitmap(1, 1)
wbm.SetSource(Await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
' If I don't have this, the DrawLine will not show up, if I do, it will.
Await Task.Delay(1000)
wbm.DrawLine(1, 1, 255, 255, Colors.Green)
wbm.Invalidate()
ImageMain.Source = wbm
Run Code Online (Sandbox Code Playgroud) filepicker writeablebitmap async-await writeablebitmapex windows-runtime
我在Windows Universal应用程序上有一个RichTextBox,我希望始终保持相同的颜色(在未选中,悬停和选中的事件期间).目前,如果我设置背景/前景颜色,它会在未选择控件时设置它们,但是一旦它悬停在上面或聚焦在颜色上,就会变回带有黑色文本的默认白色背景.
<RichEditBox HorizontalAlignment="Stretch" Margin="0,0,0,30" VerticalAlignment="Stretch"
FontFamily="Courier New" FontSize="12" IsSpellCheckEnabled="False"
Background="Black" Foreground="LightGray" IsReadOnly="True"/>
Run Code Online (Sandbox Code Playgroud)
如何通过悬停/选定的事件使"背景"和"前景"保持一致,这样它总是带有LightGray前景的黑色背景?
我正在尝试学习如何与图像的某些WinRT(Metro)对象进行交互.基本上,我正在努力创造一个"GetPixel"和"SetPixel"方法很容易使用(类同什么是在不能在Metro应用程序中使用System.Drawing.Bitmap).
为了测试,我创建了一个"Bitmap"类.它基于我从Metro文件选择器控件获得的IRandomAccessStream加载.我能够将像素数据加载到Byte数组中,然后从中创建一个BitmapImage,当我将其投入到Image控件中时,它会在XAML表单上正确呈现.
这是我的问题,我可以查看字节数组并查看单个ARGB值,但是它的像素数远远少于它应该的数量.例如,我正在加载的图像是254x197像素(254*197*4 = 200,152).当我使用下面的代码加载我的字节数组时,它只有16,382字节(也没有平均除以4).我想,这是压缩的吗?我不知道.
我的问题是,我在做什么错.我想返回一个代表,我应该有这样我就可以创建GetPixel的50038个像素(X,Y)和SetPixel(X,Y,彩色)方法200152个字节.
Public Class Bitmap
Public Sub New()
End Sub
Public Async Function Load(s As Windows.Storage.Streams.IRandomAccessStream) As Task
Dim dr As New DataReader(s.GetInputStreamAt(0))
Await dr.LoadAsync(s.Size)
Me.Pixels = New Byte(s.Size - 1) {}
dr.ReadBytes(Me.Pixels)
' We're going to get the height and the width of the image this way. ;)
Dim bi As New BitmapImage
Dim stream As New MemoryStream(Me.Pixels)
bi.SetSource(New RandomStream(stream))
Me.Width = bi.PixelWidth
Me.Height = bi.PixelHeight
End Function
Public Function ToBitmapImage() As BitmapImage
Dim bi …Run Code Online (Sandbox Code Playgroud) bytearray bitmapimage microsoft-metro windows-8 windows-runtime
c# ×2
uwp ×2
windows-8 ×2
xaml ×2
appxmanifest ×1
async-await ×1
bitmapimage ×1
bytearray ×1
filepicker ×1
python ×1
richtextbox ×1