現在、UWPのMRアプリケーションで作業中です。私はunity3d(5.5.2と2017.1.2でテスト済み)でアプリケーションを構築しています。すべてをうまく動かすと、何かコンパイルエラーは発生しません。しかし、アプリケーションをビルドするとエラーが発生しますDescriptionAttributeが私のC#スクリプトからSystem.ComponentModel
タイプまたは名前空間の名前 '説明'が見つかりません
コードスニペット
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
//Makes a dropdown menu in the inspector
public enum EGU {
[Description("")] None,
[Description("ºC")] DegreesCelcius,
[Description("kW")] KiloWatts,
[Description("kW/h")] KiloWattsPerHour,
[Description("MW")] MegaWatts,
[Description("MW/h")] MegaWattsPerHour,
[Description("M³")] CubicMeters,
[Description("M³/h")] CubicMetersPerHour,
[Description("%")] Procentage,
[Description("º")] Degrees,
[Description("l/s")] LiterPerSecond,
[Description("cm")] CentiMeters,
[Description("m")] Meters,
[Description("mg/l")] MiliGramPerLiter,
[Description("g/l")] GramPerLiter
}
希望の一部であり、私の知る限りAssets\Script\DMEWebRequest.cs(35,10): error CS0246: The type or namespace name 'DescriptionAttribute' could not be found (are you missing a using directive or an assembly reference?)
とAssets\Script\DMEWebRequest.cs(35,10): error CS0246: The type or namespace name 'Description' could not be found (are you missing a using directive or an assembly reference?)
誰かが私が欠けているものをディレクティブまたは参照把握することができます。
/T
['System.ComponentModel'名前空間]に表示されます(https://msdn.microsoft.com/en-us/library/system.componentmodel.descriptionattribute(v = vs.110).aspx)。それを加えた。 – mmushtaq
'ComponentModel'のリファレンスをどのように追加しましたか? – mmushtaq
それ以外は何も入力していませんでした...しかし、@Programmerは答えでUWPとは動作しませんでした:/ –