Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
.NETのTuple応用チャレンジ WCFとC++/CLI
Search
suusanex
April 17, 2019
Programming
0
150
.NETのTuple応用チャレンジ WCFとC++/CLI
.NETのTuple(ValueTuple)を、WCFで使えるか。そして、C++/CLIからは呼べるのか。これを実験してみました。
suusanex
April 17, 2019
Tweet
Share
More Decks by suusanex
See All by suusanex
Azure DevTestLabsはデスクトップアプリ開発のテストを楽にしてくれる
suusanex
1
35
Other Decks in Programming
See All in Programming
オンコール⼊⾨〜ページャーが鳴る前に、あなたが備えられること〜 / Before The Pager Rings
yktakaha4
2
990
システム成長を止めない!本番無停止テーブル移行の全貌
sakawe_ee
1
360
テスト駆動Kaggle
isax1015
1
620
チームで開発し事業を加速するための"良い"設計の考え方 @ サポーターズCoLab 2025-07-08
agatan
1
470
Deep Dive into ~/.claude/projects
hiragram
14
14k
SQLアンチパターン第2版 データベースプログラミングで陥りがちな失敗とその対策 / Intro to SQL Antipatterns 2nd
twada
PRO
11
1.3k
フロントエンドのパフォーマンスチューニング
koukimiura
5
2k
ふつうの技術スタックでアート作品を作ってみる
akira888
1
1.3k
AIともっと楽するE2Eテスト
myohei
8
3k
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
1.1k
AI時代のソフトウェア開発を考える(2025/07版) / Agentic Software Engineering Findy 2025-07 Edition
twada
PRO
99
37k
20250708_JAWS_opscdk
takuyay0ne
2
130
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
KATA
mclloyd
30
14k
Building Applications with DynamoDB
mza
95
6.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
750
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
The Cult of Friendly URLs
andyhume
79
6.5k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Fireside Chat
paigeccino
37
3.5k
A designer walks into a library…
pauljervisheath
207
24k
Transcript
.NETのTuple応用チャレンジ WCFとC++/CLI 須藤圭太
自己紹介 • ID:suusanex( connpass・Twitter・GitHub共通) • 名前:須藤圭太 • サイエンスパーク株式会社という独立系ソフトウェアベンダーに所属 • 4年ほど受託開発で、上流から下流まで全部を回す
• ここ6年ほどは、自社製品開発を担当 • 勉強会、今後も開いていきます。次は5/14! • 今回は「Driver Module Framework(DMF)、VS静的解析、RPCデ バッグ等」やります • https://sciencepark.connpass.com/event/126600/ • https://sciencepark.connpass.com/
Tupleとは • 複数の変数をまとめた型を、一時的に作れる • 戻り値の例 • (int retInt, string retString)Func();
• var ret = Func(); • ret.retInt; • 匿名型と違って、変数名がIntellisenseとコンパイルの対象になる • タイポしない!
応用:WCFのSOAP通信にも使えるか? • まだサポートが続いている.NET 4.5.2で実験 • 4.6以前を使う場合、NuGetでライブラリ追加が必要
• 戻り値にTupleを使ってみて、問題なくコンパイルが通った
• SOAP通信に成功、ちゃんとTupleで戻り値が取得できた • XMLの中ではItem1,Item2といった形で並んでいる <FuncResult xmlns:d4p1="http://schemas.datacontract.org/2004/07/System" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <d4p1:Item1>1</d4p1:Item1> <d4p1:Item2>1になった理由</d4p1:Item2> </FuncResult>
C++/CLIから呼べるか? • 定義はC#で、C++/CLIのコンソールアプリから呼び出す • とりあえずは書ける。Tupleの型が扱えないので、NuGetで取得
• NuGetで参照エラー • 直接参照でチャレンジ
• Tupleの変数が見れない • Item1,Item2だった(以前からあるGeneric版?) • 動いてはいるが、デバッグはできない
• .NET 4.7.2の組み込みTupleを使っても、結果は同じ
まとめ • TupleはWCFのSOAP通信にも使える • C++/CLIでも、一応使える(変数名が見れないが) • プロセス間通信のI/Fにもどんどん使っていって良さそう