私はUWPアプリケーションを開発しています。このソリューションにはC#で書かれた多くのプロジェクト(データベースなど)が含まれていますが、UIはJavaScriptプロジェクトです。ファイルまたはアセンブリを読み込めませんでしたSystem.Runtime.Serialization.Xml
C#クラスの一つは、DataContractSerializerを使用して、データベースのコピーを保存するには、次のコードが含まれています。このコードは、JSから実行しますとき
public IAsyncOperation<Boolean> Save()
{
return Save(0).AsAsyncOperation<Boolean>();
}
private async Task<Boolean> Save(Int32 notUsed)
{
try
{
updated = DateTime.Now;
StorageFile file = await ApplicationData.Current.RoamingFolder.CreateFileAsync(id + ".xml", CreationCollisionOption.ReplaceExisting);
IRandomAccessStream access = await file.OpenAsync(FileAccessMode.ReadWrite, StorageOpenOptions.AllowOnlyReaders);
Stream stream = access.AsStreamForWrite();
DataContractSerializer serializer = new DataContractSerializer(typeof(Database));
serializer.WriteObject(stream, this);
stream.Dispose();
return true;
}
catch (Exception)
{
return false;
}
}
、私は次のエラーを取得する:
0x80070002 - JavaScript runtime error: The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Xml, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
WinRT information: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Serialization.Xml, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
誰かが私を正しい方向に向けることができれば、解決策をオンラインで見つけるのに苦労していますか?
ありがとうございました。
Nugetパッケージを使用していますか? –
いいえ、Nuget(またはそのサードパーティのパッケージ)パッケージを使用していません。 – SignalOne