前提・実現したいこと
サービス参照した際に「Reference.cs」が作成されるが、中身にエンドポイントのURLがあり環境ごとにURLが異なるのでバッチでのビルド時に切り替えたいが、そもそも可能なのか?
※このプロジェクトはdllとして使用しているので、本体とは別プロジェクト
自分でもよく理解していないので頓珍漢な質問していたら申し訳ありません
該当のソースコード
C#
1 private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) 2 { 3 if ((endpointConfiguration == EndpointConfiguration.TestSoap)) 4 { 5 return new System.ServiceModel.EndpointAddress("エンドポイントURL.asmx"); //ここのURLを検証・本番等に切り替えたい 6 } 7 if ((endpointConfiguration == EndpointConfiguration.TestSoap12)) 8 { 9 return new System.ServiceModel.EndpointAddress("エンドポイントURL.asmx"); //ここのURLを検証・本番等に切り替えたい 10 } 11 throw new System.InvalidOperationException(string.Format("名前 \'{0}\' のエンドポイントは見つかりません。", endpointConfiguration)); 12 }
補足情報(FW/ツールのバージョンなど)
Visual Studio 2019
C#
.Net Core 3.1
回答1件
あなたの回答
tips
プレビュー