我有一个.NET 3.5应用程序,使用PrivateFontCollection.AddMemoryFont将字体加载到内存中,并使用它们生成图像.我最近在Windows Server 2012 R2上安装了它,它产生间歇性错误.
这个方法说明了这个问题:
private Bitmap getImage(byte[] fontFile)
{
using (PrivateFontCollection fontCollection = new PrivateFontCollection())
{
IntPtr fontBuffer = Marshal.AllocCoTaskMem(fontFile.Length);
Marshal.Copy(fontFile, 0, fontBuffer, fontFile.Length);
fontCollection.AddMemoryFont(fontBuffer, fontFile.Length);
Bitmap image = new Bitmap(200, 50);
using (Font font = new Font(fontCollection.Families[0], 11f, FontStyle.Regular))
{
using (Graphics graphics = Graphics.FromImage(image))
{
graphics.DrawString(String.Format("{0:HH:mm:ss}", DateTime.Now), font, Brushes.White, new PointF(0f, 0f));
}
}
return image;
}
}
Run Code Online (Sandbox Code Playgroud)
在Windows 7上,这一切都是一致的.在Windows Server 2012 R2上,如果使用多种字体重复调用,则会失败.例如:
getImage(File.ReadAllBytes("c:\\Windows\\Fonts\\Arial.ttf"));
Run Code Online (Sandbox Code Playgroud)
即使被调用数百次,但使用多种字体调用,它仍可正常工作:
getImage(File.ReadAllBytes("c:\\Windows\\Fonts\\Wingding.ttf"));
getImage(File.ReadAllBytes("c:\\Windows\\Fonts\\Arial.ttf"));
Run Code Online (Sandbox Code Playgroud)
将适用于前几次调用(20左右),但随后将开始产生随机结果(第二次调用有时会返回带有文本的图像 - 即它正在混合字体).
我偶尔(很少)在DrawString调用中得到"GDI +中发生了一般错误".
Windows 7上不会发生这些错误.
我已经尝试了各种选项来清理而没有任何成功.
作为一种解决方法,我尝试将字体文件写入磁盘,然后使用AddFontFile加载,但是(在Windows …
.net fonts gdi+ privatefontcollection windows-server-2012-r2
我试图在Windows Server 2012上运行phpdox - 但我收到错误:
PHP Version: 7.0.5 (WINNT)
PHPDox Version: 0.8.1.1
Exception: TheSeer\phpDox\Generator\TokenFileException (Code: 1)
Location: phar://D:/htdocs/AscPro/bin/phpdox-0.8.1.1.phar/phpdox/generator/pro
ject/TokenFile.php (Line 19)
File 'file:/D:/htdocs/AscPro/build/phpdox/tokens/AppBundle/AppBundle.php.xml'
not found
Run Code Online (Sandbox Code Playgroud)
我检查了位置,文件没有丢失.我在与jenkins的持续集成过程中遇到了这个问题.这很奇怪,因为同样的phpdox版本在ubuntu上对我有用.也许这与事实有关,所有程序都在"C:"上,包括詹金斯 - 但jenkins工作区是在"D:"上吗?
php continuous-integration symfony jenkins windows-server-2012-r2
我试过的事情:
我有以下错误日志:
[0A48:124C][2016-09-16T13:28:19]i300: Apply begin
[0A48:124C][2016-09-16T13:28:19]i010: Launching elevated engine process.
[0A48:124C][2016-09-16T13:28:19]i011: Launched elevated engine process.
[0A48:124C][2016-09-16T13:28:20]i012: Connected to elevated engine.
[0D94:0270][2016-09-16T13:28:20]i358: Pausing automatic updates.
[0D94:0270][2016-09-16T13:28:20]i359: Paused automatic updates.
[0D94:0270][2016-09-16T13:28:20]i360: Creating a system restore point.
[0D94:0270][2016-09-16T13:28:20]i362: System restore disabled, system restore point not created.
[0D94:0270][2016-09-16T13:28:20]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{e39e00c9-09be-48bb-b175-01a07b3f7538}, resume: Active, restart initiated: No, disable resume: No
[0D94:08CC][2016-09-16T13:28:20]i304: Verified existing payload: AspNetCoreModule_x64 at path: C:\ProgramData\Package Cache\{4ADC4F4A-2D55-442A-8655-FBF619F94A69}v1.0.1967\packages\aspnetcoremodule_x64_en_rc2_39.msi.
[0D94:0270][2016-09-16T13:28:20]i301: Applying execute package: AspNetCoreModule_x64, action: Repair, path: C:\ProgramData\Package Cache\{4ADC4F4A-2D55-442A-8655-FBF619F94A69}v1.0.1967\packages\aspnetcoremodule_x64_en_rc2_39.msi, …
Run Code Online (Sandbox Code Playgroud) 在Azure中的Windows Server 2012 R2上运行Postgresql 9.5
在我的应用程序上运行一些加载测试时,由于无法连接到postgres服务器而出现错误.在postgres的日志中,我收到以下消息:
无法从客户端接收数据:无法建立连接,因为目标计算机主动拒绝它.
只有在loadtest进入下一个场景时才会发生这种情况,这会触及代码的不同部分.因此需要与数据库建立新连接.但是在10-20秒之后,其余的场景完美无瑕,没有遇到任何其他打嗝.所以问题似乎是tcp连接.(我的代码重试了几次,但让它重试20秒是不可行的)
我在配置文件中使用以下设置
postgresql.conf中
listen_addresses = '*'
max_connections = 500
shared_buffers = 1024MB
temp_buffers = 2MB
work_mem = 2MB
maintenance_work_mem = 128MB
Run Code Online (Sandbox Code Playgroud)
的pg_hba.conf
host all all 0.0.0.0/0 trust
host all all ::/0 trust
Run Code Online (Sandbox Code Playgroud)
我知道,我知道..接受来自所有人的连接并不是保存,但这仅用于测试目的,并确保这些设置不会阻止任何连接.所以这个答案是无效的
我一直在监视服务器上的连接数量,在负载下它稳定在75. Postgres使用大约350mb的RAM.因此,给定配置和vm规范(7gb ram),应该有足够的空间来创建更多连接.但是,当下一个场景开始旋转时,连接数不会增加,它会保持水平并开始提供这些关于无连接的日志消息.
这可能是什么问题?
windows postgresql database-connection azure windows-server-2012-r2
我尝试在 Windows Server 2012 上安装Active Directory 联合身份验证服务,但不断收到此错误:
目标机器未加入域
在顶部,您可以看到目标服务器有我的服务器名称。为什么我会收到此错误?我该如何修复它?
active-directory windows-server windows-server-2012-r2 adfs3.0
我有一个Windows 2012服务器和hello world节点js文件(仅一个js文件以及Node_module文件夹)。
现在,我需要将其部署到Windows服务器,并需要全局运行。
怎么做?请帮我!
我已阅读更多文章。但是很困惑。我在服务器上安装了Node app。我在本地运行。这是工作。但是如何在全球范围内做到这一点。(www.xxxx.com/ABC)
谢谢
桑卡兰A
所以我创建了一个安装 Windows 更新的 PowerShell 脚本,
您可能知道,在安装更新时,为了安装脚本,PC 可能必须重新启动(当仍有更新时)。
我实现的是在脚本开始时导入并在每次重新启动后运行脚本的任务(并在登录屏幕上安装剩余的脚本),直到没有更多的脚本剩下。
最后一次更新后,脚本将从任务调度程序中删除任务。
我的实现(下载/安装/添加任务/删除任务)完美运行。
只是我的脚本在重新启动后不会运行,我不知道为什么!
电脑重新启动后,脚本不再运行,任务调度程序中的错误状态为0x1
我做了一些谷歌搜索,发现参数可能是错误的(第三张图片当然路径是正确的)但我已经尝试过(在参数字段中):
任务调度程序没有启动我的脚本可能是什么问题?
谢谢
编辑
添加了作为批处理作业属性登录的屏幕截图:
我在 Web 应用程序代理中使用非声明感知应用程序。服务器:Windows Server 2016 ADFS:v3.0 - Windows Server 2012 R2
但每当我请求应用程序 URL 时,成功身份验证后都会附加一个查询字符串参数“authtoken”。
我怎样才能删除这个令牌?
iis asp.net-mvc proxy windows-authentication windows-server-2012-r2
我在生产服务器上使用 Windows Server 2012 R2。我将 Web 应用程序从 4.5 升级到 .Net 5.0。现在,当我的前端应用程序与基于 .Net 5.0 构建的后端 REST API 进行通信时,随机遇到此错误:
异常[System.AggregateException:发生一个或多个错误。(无法建立 SSL 连接,请参阅内部异常。) ---> System.Net.Http.HttpRequestException:无法建立 SSL 连接,请参阅内部异常。---> System.Security.Authentication.AuthenticationException:身份验证失败,因为远程方发送了 TLS 警报:“HandshakeFailure”。---> System.ComponentModel.Win32Exception (0x80090326): 收到的消息是意外的或格式错误。
--- 内部异常堆栈跟踪结束 ---
我已经在我的应用程序中使用了以下代码行:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13;
Run Code Online (Sandbox Code Playgroud)