forked from Banani-Rath/docs.ja-jp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,062 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,78 @@ | ||
--- | ||
title: "コンパイラ エラー CS0011 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0011" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0011" | ||
--- | ||
title: "コンパイラ エラー CS0011" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0011 | ||
helpviewer_keywords: CS0011 | ||
ms.assetid: 892553d7-a516-4631-84cd-94db5722c90d | ||
caps.latest.revision: 18 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 18 | ||
--- | ||
# コンパイラ エラー CS0011 | ||
caps.latest.revision: "18" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: aebbf050396ecd3ddb325cd08de38aee758d7533 | ||
ms.sourcegitcommit: 4f3fef493080a43e70e951223894768d36ce430a | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 11/21/2017 | ||
--- | ||
# <a name="compiler-error-cs0011"></a>コンパイラ エラー CS0011 | ||
型 'type' で参照されているアセンブリ 'assembly' の基底クラスまたはインターフェイス 'class' が解決できません | ||
|
||
**\/reference** を使用してファイルからインポートされたクラスが、あるクラスの派生クラスであるか、または見つからないインターフェイスを実装しています。 このエラーは、必要な DLL が **\/reference** を使用したコンパイル時にインクルードされていない場合に発生することがあります。 | ||
**/reference**を使用してファイルからインポートされたクラスが、あるクラスの派生クラスであるか、または見つからないインターフェイスを実装しています。 このエラーは、必要な DLL が **/reference**を使用したコンパイル時にインクルードされていない場合に発生することがあります。 | ||
|
||
詳細については、次のトピックを参照してください。[Add Reference Dialog Box](http://msdn.microsoft.com/ja-jp/2feb0fe2-0805-4cc9-8cba-b0315849dfb7) および[\/reference \(Import Metadata\)](../../csharp/language-reference/compiler-options/reference-compiler-option.md). | ||
詳細については、次を参照してください。[参照の追加 ダイアログ ボックス](http://msdn.microsoft.com/en-us/2feb0fe2-0805-4cc9-8cba-b0315849dfb7)と[/reference (c# コンパイラ オプション)](../../csharp/language-reference/compiler-options/reference-compiler-option.md)です。 | ||
|
||
## 使用例 | ||
## <a name="example"></a>例 | ||
|
||
``` | ||
// CS0011_1.cs // compile with: /target:library public class Outer { public class B { } } | ||
// CS0011_1.cs | ||
// compile with: /target:library | ||
public class Outer | ||
{ | ||
public class B { } | ||
} | ||
``` | ||
|
||
## 使用例 | ||
2 つ目のファイルでは、前の例で作成した `B` クラスから派生した `C` クラスを定義する DLL を作成します。 | ||
## <a name="example"></a>例 | ||
2 つ目のファイルでは、前の例で作成した `C` クラスから派生した `B` クラスを定義する DLL を作成します。 | ||
|
||
``` | ||
// CS0011_2.cs // compile with: /target:library /reference:CS0011_1.dll // post-build command: del /f CS0011_1.dll public class C : Outer.B {} | ||
// CS0011_2.cs | ||
// compile with: /target:library /reference:CS0011_1.dll | ||
// post-build command: del /f CS0011_1.dll | ||
public class C : Outer.B {} | ||
``` | ||
|
||
## 使用例 | ||
3 つ目のファイルでは、最初の手順で作成した DLL を置き換え、内部クラスである `B` の定義を省略しています。 | ||
## <a name="example"></a>例 | ||
3 つ目のファイルでは、最初の手順で作成した DLL を置き換え、内部クラスである `B`の定義を省略しています。 | ||
|
||
``` | ||
// CS0011_3.cs // compile with: /target:library /out:cs0011_1.dll public class Outer {} | ||
// CS0011_3.cs | ||
// compile with: /target:library /out:cs0011_1.dll | ||
public class Outer {} | ||
``` | ||
|
||
## 使用例 | ||
最後に、4 つ目のファイルで、2 番目の例で定義した `C` クラスを参照します。これは `B` クラスから派生していますが、今回、これはありません。 | ||
## <a name="example"></a>例 | ||
最後に、4 つ目のファイルで、2 番目の例で定義した `C` クラスを参照します。これは `B`クラスから派生していますが、今回、これはありません。 | ||
|
||
次の例では CS0011 が生成されます。 | ||
|
||
``` | ||
// CS0011_4.cs // compile with: /reference:CS0011_1.dll /reference:CS0011_2.dll // CS0011 expected class M { public static void Main() { C c = new C(); } } | ||
// CS0011_4.cs | ||
// compile with: /reference:CS0011_1.dll /reference:CS0011_2.dll | ||
// CS0011 expected | ||
class M | ||
{ | ||
public static void Main() | ||
{ | ||
C c = new C(); | ||
} | ||
} | ||
``` | ||
|
||
## 参照 | ||
[Add Reference Dialog Box](http://msdn.microsoft.com/ja-jp/2feb0fe2-0805-4cc9-8cba-b0315849dfb7) | ||
[\/reference \(Import Metadata\)](../../csharp/language-reference/compiler-options/reference-compiler-option.md) | ||
## <a name="see-also"></a>関連項目 | ||
[参照の追加 ダイアログ ボックス](http://msdn.microsoft.com/en-us/2feb0fe2-0805-4cc9-8cba-b0315849dfb7) | ||
[-reference (C# コンパイラ オプション)](../../csharp/language-reference/compiler-options/reference-compiler-option.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,60 @@ | ||
--- | ||
title: "コンパイラ エラー CS0012 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0012" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0012" | ||
--- | ||
title: "コンパイラ エラー CS0012" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0012 | ||
helpviewer_keywords: CS0012 | ||
ms.assetid: 5523e349-22f4-4b0b-b4b0-c4bf26c461f4 | ||
caps.latest.revision: 10 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 10 | ||
--- | ||
# コンパイラ エラー CS0012 | ||
caps.latest.revision: "10" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: 0719b82af366ced0309ac20da2efb4ac79906dc5 | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-error-cs0012"></a>コンパイラ エラー CS0012 | ||
型 'type' は、参照されていないアセンブリに定義されています。 アセンブリ 'assembly' に参照を追加する必要があります。 | ||
|
||
参照される型の定義が見つかりませんでした。 このエラーは、必要な .DLL ファイルがコンパイル時にインクルードされていない場合に発生することがあります。 詳細については、次のトピックを参照してください。[Add Reference Dialog Box](http://msdn.microsoft.com/ja-jp/2feb0fe2-0805-4cc9-8cba-b0315849dfb7) および[\/reference \(Import Metadata\)](../../csharp/language-reference/compiler-options/reference-compiler-option.md). | ||
参照される型の定義が見つかりませんでした。 このエラーは、必要な .DLL ファイルがコンパイル時にインクルードされていない場合に発生することがあります。 詳細については、次を参照してください。[参照の追加 ダイアログ ボックス](http://msdn.microsoft.com/en-us/2feb0fe2-0805-4cc9-8cba-b0315849dfb7)と[/reference (c# コンパイラ オプション)](../../csharp/language-reference/compiler-options/reference-compiler-option.md)です。 | ||
|
||
次のコンパイル シーケンスは CS0012 になります。 | ||
|
||
``` | ||
// cs0012a.cs // compile with: /target:library public class A {} | ||
// cs0012a.cs | ||
// compile with: /target:library | ||
public class A {} | ||
``` | ||
|
||
次のコードも同様の結果になります。 | ||
|
||
``` | ||
// cs0012b.cs // compile with: /target:library /reference:cs0012a.dll public class B { public static A f() { return new A(); } } | ||
// cs0012b.cs | ||
// compile with: /target:library /reference:cs0012a.dll | ||
public class B | ||
{ | ||
public static A f() | ||
{ | ||
return new A(); | ||
} | ||
} | ||
``` | ||
|
||
次のコードも同様の結果になります。 | ||
|
||
``` | ||
// cs0012c.cs // compile with: /reference:cs0012b.dll class C { public static void Main() { object o = B.f(); // CS0012 } } | ||
// cs0012c.cs | ||
// compile with: /reference:cs0012b.dll | ||
class C | ||
{ | ||
public static void Main() | ||
{ | ||
object o = B.f(); // CS0012 | ||
} | ||
} | ||
``` | ||
|
||
この CS0012 は、`/reference:cs0012b.dll;cs0012a.dll` を使用してコンパイルするか、Visual Studio で [Add Reference Dialog Box](http://msdn.microsoft.com/ja-jp/2feb0fe2-0805-4cc9-8cba-b0315849dfb7) を使用して cs0012b.dll と cs0012a.dll への参照を追加することで解決できる場合があります。 | ||
この CS0012 は、 `/reference:cs0012b.dll;cs0012a.dll`を使用してコンパイルするか、Visual Studio で [Add Reference Dialog Box](http://msdn.microsoft.com/en-us/2feb0fe2-0805-4cc9-8cba-b0315849dfb7) を使用して cs0012b.dll と cs0012a.dll への参照を追加することで解決できる場合があります。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,40 @@ | ||
--- | ||
title: "コンパイラ エラー CS0140 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0140" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0140" | ||
--- | ||
title: "コンパイラ エラー CS0140" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0140 | ||
helpviewer_keywords: CS0140 | ||
ms.assetid: 61787b8a-7b69-41c1-8ee3-87f619698594 | ||
caps.latest.revision: 7 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 7 | ||
--- | ||
# コンパイラ エラー CS0140 | ||
caps.latest.revision: "7" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: ff973ccee4299235bc0d45c7b9185e87abe1404a | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-error-cs0140"></a>コンパイラ エラー CS0140 | ||
ラベル 'label' は重複しています。 | ||
|
||
同じ名前のラベルが 2 回使用されています。 詳細については、「[goto](../../csharp/language-reference/keywords/goto.md)」を参照してください。 | ||
同じ名前のラベルが 2 回使用されています。 詳細については、次を参照してください。 [goto](../../csharp/language-reference/keywords/goto.md)です。 | ||
|
||
次の例では CS0140 が生成されます。 | ||
|
||
``` | ||
// CS0140.cs namespace MyNamespace { public class MyClass { public static void Main() { label1: int i = 0; label1: int j = 0; // CS0140, comment this line to resolve goto label1; } } } | ||
``` | ||
// CS0140.cs | ||
namespace MyNamespace | ||
{ | ||
public class MyClass | ||
{ | ||
public static void Main() | ||
{ | ||
label1: int i = 0; | ||
label1: int j = 0; // CS0140, comment this line to resolve | ||
goto label1; | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
--- | ||
title: "コンパイラ エラー CS0180 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0180" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0180" | ||
--- | ||
title: "コンパイラ エラー CS0180" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0180 | ||
helpviewer_keywords: CS0180 | ||
ms.assetid: a21bf0a2-ed5a-4ddd-88d3-240babc5888a | ||
caps.latest.revision: 8 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 8 | ||
--- | ||
# コンパイラ エラー CS0180 | ||
caps.latest.revision: "8" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: 36fa02738c804e1034281906d2afa7e1bba6bb24 | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-error-cs0180"></a>コンパイラ エラー CS0180 | ||
'member' に extern と abstract の両方を指定することはできません | ||
|
||
[abstract](../../csharp/language-reference/keywords/abstract.md) キーワードと [extern](../../csharp/language-reference/keywords/extern.md) キーワードは、同時に指定できません。`extern` キーワードは、メンバーがファイルの外部で定義されていることを意味し、**abstract** は、派生クラスで実装が提供されることを意味します。 詳細については、「[メソッド](../../csharp/programming-guide/classes-and-structs/methods.md)」を参照してください。 | ||
[abstract](../../csharp/language-reference/keywords/abstract.md) キーワードと [extern](../../csharp/language-reference/keywords/extern.md) キーワードは、同時に指定できません。 `extern` キーワードは、メンバーがファイルの外部で定義されていることを意味し、 **abstract** は、派生クラスで実装が提供されることを意味します。 詳細については、「[メソッド](../../csharp/programming-guide/classes-and-structs/methods.md)」を参照してください。 | ||
|
||
次の例では CS0180 が生成されます。 | ||
|
||
``` | ||
// CS0180.cs namespace MyNamespace { public class MyClass { public extern abstract int Foo(int a); // CS0180 public static void Main() { } } } | ||
``` | ||
// CS0180.cs | ||
namespace MyNamespace | ||
{ | ||
public class MyClass | ||
{ | ||
public extern abstract int Foo(int a); // CS0180 | ||
public static void Main() | ||
{ | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,42 @@ | ||
--- | ||
title: "コンパイラの警告 (レベル 2) CS0253 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0253" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0253" | ||
--- | ||
title: "コンパイラの警告 (レベル 2) CS0253" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0253 | ||
helpviewer_keywords: CS0253 | ||
ms.assetid: e02d5dac-c2d9-45ca-9dd3-dda06c96f4d6 | ||
caps.latest.revision: 6 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 6 | ||
--- | ||
# コンパイラの警告 (レベル 2) CS0253 | ||
caps.latest.revision: "6" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: a4fc3df6a3cc19ba85de75137e808d569965ce32 | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-warning-level-2-cs0253"></a>コンパイラの警告 (レベル 2) CS0253 | ||
予期しない参照比較です。比較値を取得するには型 'type' に右辺をキャストしてください | ||
|
||
コンパイラが参照比較を行っています。 文字列の値を比較する場合は、式の右辺を `type` にキャストしてください。 | ||
コンパイラが参照比較を行っています。 文字列の値を比較する場合は、式の右辺を `type`にキャストしてください。 | ||
|
||
次の例では CS0253 が生成されます。 | ||
|
||
``` | ||
// CS0253.cs // compile with: /W:2 using System; class MyClass { public static void Main() { string s = "11"; object o = s + s; bool c = s == o; // CS0253 // try the following line instead // bool c = s == (string)o; } } | ||
``` | ||
// CS0253.cs | ||
// compile with: /W:2 | ||
using System; | ||
class MyClass | ||
{ | ||
public static void Main() | ||
{ | ||
string s = "11"; | ||
object o = s + s; | ||
bool c = s == o; // CS0253 | ||
// try the following line instead | ||
// bool c = s == (string)o; | ||
} | ||
} | ||
``` |
Oops, something went wrong.