Skip to content

Commit 1308cfa

Browse files
committed
add sample code.
1 parent ddc893b commit 1308cfa

File tree

5 files changed

+157
-0
lines changed

5 files changed

+157
-0
lines changed

SampleConsoleApp/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
5+
</startup>
6+
</configuration>

SampleConsoleApp/Program.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Diagnostics;
7+
using ruby.csharp_script;
8+
9+
namespace SampleConsoleApp
10+
{
11+
class Program
12+
{
13+
static void Main(string[] args)
14+
{
15+
var csharp_script = new CSharpScript();
16+
var result = csharp_script.EvaluateAsync("1+1");
17+
Console.WriteLine(result);
18+
Console.ReadLine();
19+
}
20+
}
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
6+
// アセンブリに関連付けられている情報を変更するには、
7+
// これらの属性値を変更してください。
8+
[assembly: AssemblyTitle("SampleConsoleApp")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("SampleConsoleApp")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから
18+
// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、
19+
// その型の ComVisible 属性を true に設定してください。
20+
[assembly: ComVisible(false)]
21+
22+
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
23+
[assembly: Guid("268de157-4a87-4a77-b284-b9e4b7b3393e")]
24+
25+
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
26+
//
27+
// メジャー バージョン
28+
// マイナー バージョン
29+
// ビルド番号
30+
// Revision
31+
//
32+
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
33+
// 既定値にすることができます:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{268DE157-4A87-4A77-B284-B9E4B7B3393E}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>SampleConsoleApp</RootNamespace>
10+
<AssemblyName>SampleConsoleApp</AssemblyName>
11+
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
<Prefer32Bit>false</Prefer32Bit>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>x64</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
36+
<DebugSymbols>true</DebugSymbols>
37+
<OutputPath>bin\x64\Debug\</OutputPath>
38+
<DefineConstants>DEBUG;TRACE</DefineConstants>
39+
<DebugType>full</DebugType>
40+
<PlatformTarget>x64</PlatformTarget>
41+
<ErrorReport>prompt</ErrorReport>
42+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
43+
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
45+
<OutputPath>bin\x64\Release\</OutputPath>
46+
<DefineConstants>TRACE</DefineConstants>
47+
<Optimize>true</Optimize>
48+
<DebugType>pdbonly</DebugType>
49+
<PlatformTarget>x64</PlatformTarget>
50+
<ErrorReport>prompt</ErrorReport>
51+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
52+
<Prefer32Bit>true</Prefer32Bit>
53+
</PropertyGroup>
54+
<ItemGroup>
55+
<Reference Include="System" />
56+
<Reference Include="System.Core" />
57+
<Reference Include="System.Xml.Linq" />
58+
<Reference Include="System.Data.DataSetExtensions" />
59+
<Reference Include="Microsoft.CSharp" />
60+
<Reference Include="System.Data" />
61+
<Reference Include="System.Net.Http" />
62+
<Reference Include="System.Xml" />
63+
</ItemGroup>
64+
<ItemGroup>
65+
<Compile Include="Program.cs" />
66+
<Compile Include="Properties\AssemblyInfo.cs" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<None Include="App.config" />
70+
</ItemGroup>
71+
<ItemGroup>
72+
<ProjectReference Include="..\ruby-csharp_script\ruby-csharp_script.csproj">
73+
<Project>{26ef5196-b3b6-4cd3-ba09-c8d9d4ed4cc0}</Project>
74+
<Name>ruby-csharp_script</Name>
75+
</ProjectReference>
76+
</ItemGroup>
77+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78+
</Project>

ruby-csharp_script.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,36 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ruby-csharp_script", "ruby-
77
EndProject
88
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "ruby-csharp_script_installer", "ruby-csharp_script_installer\ruby-csharp_script_installer.wixproj", "{E1603D79-2B22-462D-9103-EEC0B97D8BF7}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleConsoleApp", "SampleConsoleApp\SampleConsoleApp.csproj", "{268DE157-4A87-4A77-B284-B9E4B7B3393E}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
1215
Debug|x64 = Debug|x64
16+
Release|Any CPU = Release|Any CPU
1317
Release|x64 = Release|x64
1418
EndGlobalSection
1519
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{26EF5196-B3B6-4CD3-BA09-C8D9D4ED4CC0}.Debug|Any CPU.ActiveCfg = Debug|x64
1621
{26EF5196-B3B6-4CD3-BA09-C8D9D4ED4CC0}.Debug|x64.ActiveCfg = Debug|x64
1722
{26EF5196-B3B6-4CD3-BA09-C8D9D4ED4CC0}.Debug|x64.Build.0 = Debug|x64
23+
{26EF5196-B3B6-4CD3-BA09-C8D9D4ED4CC0}.Release|Any CPU.ActiveCfg = Release|x64
1824
{26EF5196-B3B6-4CD3-BA09-C8D9D4ED4CC0}.Release|x64.ActiveCfg = Release|x64
1925
{26EF5196-B3B6-4CD3-BA09-C8D9D4ED4CC0}.Release|x64.Build.0 = Release|x64
26+
{E1603D79-2B22-462D-9103-EEC0B97D8BF7}.Debug|Any CPU.ActiveCfg = Debug|x86
2027
{E1603D79-2B22-462D-9103-EEC0B97D8BF7}.Debug|x64.ActiveCfg = Debug|x64
2128
{E1603D79-2B22-462D-9103-EEC0B97D8BF7}.Debug|x64.Build.0 = Debug|x64
29+
{E1603D79-2B22-462D-9103-EEC0B97D8BF7}.Release|Any CPU.ActiveCfg = Release|x86
2230
{E1603D79-2B22-462D-9103-EEC0B97D8BF7}.Release|x64.ActiveCfg = Release|x64
2331
{E1603D79-2B22-462D-9103-EEC0B97D8BF7}.Release|x64.Build.0 = Release|x64
32+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Debug|x64.ActiveCfg = Debug|x64
35+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Debug|x64.Build.0 = Debug|x64
36+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Release|x64.ActiveCfg = Release|Any CPU
39+
{268DE157-4A87-4A77-B284-B9E4B7B3393E}.Release|x64.Build.0 = Release|Any CPU
2440
EndGlobalSection
2541
GlobalSection(SolutionProperties) = preSolution
2642
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)