Unityで Object at index 0 is null エラーが発生する。
プロジェクトの Library 、obj 、 Temp フォルダーを削除してプロジェクトを読み込むと発生しなくなります。
アプリケーションとプログラミングの詳細
https://github.com/setokynet/vs2017-winrt-angel_opengl
CoreWindowNativeWindow.cpp を次のように変更しました。
static float GetLogicalDpi() { // ComPtr<ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> displayProperties; ComPtr<ABI::Windows::Graphics::Display::IDisplayInformation> displayProperties; // if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayProperties).Get(), displayProperties.GetAddressOf()))) if (SUCCEEDED(GetActivationFactory(HStringReference(RuntimeClass_Windows_Graphics_Display_DisplayInformation).Get(), displayProperties.GetAddressOf()))) { float dpi = 96.0f; if (SUCCEEDED(displayProperties->get_LogicalDpi(&dpi))) { return dpi; } } // Return 96 dpi as a default if display properties cannot be obtained. return 96.0f; }
IDisplayPropertiesStaticsとDisplayPropertiesStatics は Windows Phone 8.1 対応が必要となり、Winrt(UWP)では使用できないためIDisplayInformationとDisplayInformationに変更しました。コードの変数はdisplaypropertiesのまま変更していません。
github.com/setokynet/vs2017-winrt-angel_opengl にはCoreWindowNativeWindow.cppは含まれていません。angle-ms-master\src\libANGLE\renderer\d3d\d3d11\winrt\CoreWindowNativeWindow.cpp のGetLogicalDpi()を修正してください。
#include “id/commit.h” が含まれていてコンパイルできない場合、mklink /D /J angle-ms-master\src\id angle-ms-master\src でシンボリックリンクを作成するとコードを修正することなくコンパイルできます。
DISM を使ってイメージをマウントおよび変更する (https://msdn.microsoft.com/ja-jp/library/hh824814.aspx)
DISM イメージ管理のコマンド ライン オプション (https://msdn.microsoft.com/ja-jp/library/hh825258.aspx)
Dism /Get-WIMInfo /WimFile:c:\win10\install.wim
適用したいエディションのインデックスを確認します。以下1に対して適用するものとします。
Dism /Get-WIMInfo /WimFile:c:\win10\install.esd
適用したいエディションのインデックスを確認します。以下1に対して適用するものとします。
Dism /Apply-Image /ImageFile:C:\win10\install.esd /index:1 /MountDir:C:\win10\Mount
Dism /Capture-Image /ImageFile:c:\win10\install.wim /CaptureDir:c:\win10\Mount /Name:"Windows 10"
Packageの追加、削除、コミット、アンマウントは上記Wimファイルと同様です。
Dism /Export-Image /SourceImageFile:c:\win10\install.wim /SourceIndex:1 /DestinationImageFile:c:\win10\install.esd /DestinationName:"Windows 10" /Compress:recovery
イベント 3001, LoadPerf について n は1846の場合が多いようです。
イベント 3009, LoadPerf のサービスについて .NET CLR Data, .NET CLR Networking, .NET Data Provider for Oracle, .NET Data Provider for SqlServer, aspnet_state, Remote Access, UGHTRSVC, usbhub, WSearch, WSearchIdxPi, WSService においても同様のメッセージが書き込まれることがあります。
イベント 1008, perflib に関しては、ほかに aspnet_state, ASP.NET_4.0.30319, ASP.NET, .NETFramework も同様のエラーが発生する場合があります。
対応するサービス(%SystemRoot%\Inf のサブフォルダー名)
%SystemRoot%\Inf\(ServiceName) フォルダー内のiniファイルの末尾が _d.ini のファイルは 親フォルダーの ini ファイルを参照しています。ほとんどの場合 サイズが 1KByte 以下です。そしてファイルの日時が異なりますが同じ内容となっています。_d.iniファイルが存在しない場合、0409, 0411等のフォルダーのiniファイルに記述があります。
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\(name)\PerformanceキーのPerfInFileにパフォーマンスカウンタに使用する.iniファイル名の記載があります。
インストールディスク、または %SystemRoot%\Winsxs のサブフォルダーから該当するファイルをコピーします。この際、下記の通りインストールしている言語パックに対応するフォルダーのみコピーを行います。コピーを行ったファイルに対してcaclsを利用してアクセス権を設定しなおします。ASP.NET_2.0.50727, ASP.NET_64_2.0.50727, MSDTC Bridge 3.0.0.0, ServiceModelEndpoint 3.0.0.0, ServiceModelOperation 3.0.0.0, ServiceModelService 3.0.0.0, SMSvcHost 3.0.0.0, Windows Workflow Foundation 3.0.0.0 に存在するファイルに対しては行う必要はありません。
[例]
xcopy %SystemRoot%\WinSxS\amd64_netfx4-_dataperfcounters_ini_b03f5f7f11d50a3a_4.0.15522.0_none_69a84f70710ce8f7\_DataPerfCounters_d.ini %SystemRoot%\Inf\.NET CLR Data
アクセス権を変更します。
cacls (file) /S: "D:PAI(A;;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;;0x1200a9;;;BA)(A;;0x1200a9;;;SY)(A;;0x1200a9;;;BU)(A;;0x1200a9;;;AC)(A;;0x1200a9;;;S-1-15-2-2)"
を実行してアクセス権を修正します。
_none は 0000, _en-us は 0409 or 0009, _ja-jp は 0411 or 0011 の対応となります。
フォルダーの中に ファイルが存在しない、空のフォルダーが存在すると lodctr /R を実行したときに First Counter, First Help, Last Counter, Last Help の値が正しく設定されず消去されてしまいます。空のフォルダーを削除してから実行してください。使用している言語以外の対応するフォルダーを削除します。
regedit.exeを開いて次のレジストリーキーを参照します。HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\(name)\Performance を参照します。
(例)
lodctr /R を コマンドプロンプトから実行します。「情報: パフォーマンス カウンタの設定をシステムのバックアップ ストアから正常に再構築しました」が表示されます。HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\(name)\Performance のFirst Counter, First Help, Last Counter, Last Help の値が正しく設定されているか確認します。
Dism /Online /Cleanup-Image /RestoreHealth を実行します。
sfc /scannow を実行します。
正しく構成されていないと システムが不安定になったり、OSの動作が遅くなったりします。単にパフォーマンスカウンタのエラーだけでなく、Windows Update でシステムファイルが更新されないなどの不具合につながるおそれがあります。
XmlDocument _xmldocument = new XmlDocument(); XmlElement _xmlelement = _xmldocument.Create("root","http://www.setokynet.com/"); xmldocument.AppendChild(_xmlelement); XmlElement _item = _xmldocument.Create("item"); xmlelement.AppendChild(_item); XmlElement _item2 = _xmldocument.Create("item", "http://www.setokynet.com/"); xmlelement.AppendChild(_item2); XmlElement _item3 = _xmldocument.Create("item",_xmldocument.DocumentElement.NamespaceURI); _xmlelement.AppendChild(_item3);
<root xmlns="http://www.setokynet.com/"> <item xmlns="" /> <item xmlns="http://www.setokynet.com/" /> <item /> </root>
子要素についてDocumentElementの名前空間を使用する場合、_xmldocument.DocumentElement.NamespaceURI (_xmlelement.NamespaceURI) を指定します。