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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
suusanex
April 17, 2019
Programming
0
160
.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
37
Other Decks in Programming
See All in Programming
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
100
Package Management Learnings from Homebrew
mikemcquaid
0
200
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
CSC307 Lecture 06
javiergs
PRO
0
680
SourceGeneratorのススメ
htkym
0
190
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
AtCoder Conference 2025
shindannin
0
1k
CSC307 Lecture 01
javiergs
PRO
0
690
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
250
Featured
See All Featured
Designing Experiences People Love
moore
144
24k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
Designing for Performance
lara
610
70k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
The SEO Collaboration Effect
kristinabergwall1
0
350
Practical Orchestrator
shlominoach
191
11k
Deep Space Network (abreviated)
tonyrice
0
45
It's Worth the Effort
3n
188
29k
What's in a price? How to price your products and services
michaelherold
247
13k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
290
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にもどんどん使っていって良さそう