質問するログイン新規登録

質問編集履歴

2

回答用に画像を追加しました。

2018/12/25 01:52

投稿

firstlast
firstlast

スコア138

title CHANGED
File without changes
body CHANGED
@@ -35,4 +35,54 @@
35
35
  ### 環境
36
36
  Microsoft Windows 10 Pro (Version 1809)
37
37
  Microsoft Visual Studio Community 2017(Version 15.9.4)
38
- Microsoft .NET Framework(Version 4.7.03190)
38
+ Microsoft .NET Framework(Version 4.7.03190)
39
+
40
+ ###追加
41
+ 以下のようなクラスライブラリ(.NET Standard)を作り、
42
+ ```C#
43
+ using System;
44
+
45
+ namespace TestLibrary1
46
+ {
47
+ public class Animal
48
+ {
49
+ public int Aaa()
50
+ {
51
+ System.Collections.Generic.List<string> stringList = new System.Collections.Generic.List<string>();
52
+ stringList.Add("にゃんにゃん");
53
+ stringList.Add("わんわん");
54
+ return stringList.Count;
55
+ }
56
+
57
+ }
58
+ }
59
+ ```
60
+
61
+ 以下のようなWindowsフォームアプリケーション(.NET Framework)で参照して呼び出す。
62
+
63
+ ```C#
64
+ using System;
65
+ using System.Windows.Forms;
66
+
67
+ namespace WindowsFormsApp1
68
+ {
69
+ public partial class Form1 : Form
70
+ {
71
+ public Form1()
72
+ {
73
+ InitializeComponent();
74
+ }
75
+
76
+ private void Form1_Load(object sender, EventArgs e)
77
+ {
78
+ //System.Collections.Generic.List<string> stringList = new System.Collections.Generic.List<string>();
79
+ //stringList.Add("にゃんにゃん");
80
+ //stringList.Add("わんわん");
81
+ //MessageBox.Show(stringList.Count.ToString());
82
+ MessageBox.Show(new TestLibrary1.Animal().Aaa().ToString());
83
+ }
84
+ }
85
+ }
86
+ ```
87
+ ![イメージ説明](04a6763436c9cee2f818c172d4b8acfe.jpeg)
88
+ ![イメージ説明](c15f619897ae4764f46014530959b384.jpeg)

1

回答用に画像を追加しました。

2018/12/25 01:52

投稿

firstlast
firstlast

スコア138

title CHANGED
File without changes
body CHANGED
File without changes