LastExceed
LastExceed
CC#
Created by LastExceed on 1/28/2025 in #help
how do i generate WCF connected services on build/restore?
I spent many hours reading through MSDN trying to wrap my head around MSBuild, but the best I was able to put together is this:
<Target Name="CodeGenPre">
<!-- no idea why this is necessary -->
<Exec Command="dotnet tool restore"
ConsoleToMsBuild="true"/>
</Target>



<Target Name="CodeGen1"
Condition="!Exists('Connected Services/MyService1/Reference.cs')"
DependsOnTargets="CodeGenPre"
BeforeTargets="BeforeBuild"
>
<Exec Command="dotnet dotnet-svcutil --noLogo --update &quot;Connected Services\MyService1\ConnectedService.json&quot;"
ConsoleToMsBuild="true"/>
<ItemGroup>
<Compile Include="Connected Services/MyService1/Reference.cs"/>
</ItemGroup>
</Target>



<Target Name="CodeGen2"
Condition="!Exists('Connected Services/MyService2/Reference.cs')"
DependsOnTargets="CodeGenPre"
BeforeTargets="BeforeBuild"
>
<Exec Command="dotnet dotnet-svcutil --noLogo --update &quot;Connected Services\MyService2\ConnectedService.json&quot;"
ConsoleToMsBuild="true"/>
<ItemGroup>
<Compile Include="Connected Services/MyService2/Reference.cs"/>
</ItemGroup>
</Target>



<Target Name="CodeGen3"
Condition="!Exists('Connected Services/MyService3/Reference.cs')"
DependsOnTargets="CodeGenPre"
BeforeTargets="BeforeBuild"
>
<Exec Command="dotnet dotnet-svcutil --noLogo --update &quot;Connected Services\MyService3\ConnectedService.json&quot;"
ConsoleToMsBuild="true"/>
<ItemGroup>
<Compile Include="Connected Services/MyService3/Reference.cs"/>
</ItemGroup>
</Target>
<Target Name="CodeGenPre">
<!-- no idea why this is necessary -->
<Exec Command="dotnet tool restore"
ConsoleToMsBuild="true"/>
</Target>



<Target Name="CodeGen1"
Condition="!Exists('Connected Services/MyService1/Reference.cs')"
DependsOnTargets="CodeGenPre"
BeforeTargets="BeforeBuild"
>
<Exec Command="dotnet dotnet-svcutil --noLogo --update &quot;Connected Services\MyService1\ConnectedService.json&quot;"
ConsoleToMsBuild="true"/>
<ItemGroup>
<Compile Include="Connected Services/MyService1/Reference.cs"/>
</ItemGroup>
</Target>



<Target Name="CodeGen2"
Condition="!Exists('Connected Services/MyService2/Reference.cs')"
DependsOnTargets="CodeGenPre"
BeforeTargets="BeforeBuild"
>
<Exec Command="dotnet dotnet-svcutil --noLogo --update &quot;Connected Services\MyService2\ConnectedService.json&quot;"
ConsoleToMsBuild="true"/>
<ItemGroup>
<Compile Include="Connected Services/MyService2/Reference.cs"/>
</ItemGroup>
</Target>



<Target Name="CodeGen3"
Condition="!Exists('Connected Services/MyService3/Reference.cs')"
DependsOnTargets="CodeGenPre"
BeforeTargets="BeforeBuild"
>
<Exec Command="dotnet dotnet-svcutil --noLogo --update &quot;Connected Services\MyService3\ConnectedService.json&quot;"
ConsoleToMsBuild="true"/>
<ItemGroup>
<Compile Include="Connected Services/MyService3/Reference.cs"/>
</ItemGroup>
</Target>
very copypasty, very slow (compared to doing it manually using the UI), CodeGen1-3 run sequentially (even more slow), and it doesn't use the provider configured in the ConnectedService.json file. There gotta be a better way to do this. how?
3 replies
CC#
Created by LastExceed on 1/21/2025 in #help
✅ When should/shouldn't I split off code into a separate lib project?
ok forget my predictions, i really just meant to ask: does project splitting change what is and isn't recompiled? (idk how much compilers can reuse from previous builds)
76 replies
CC#
Created by LastExceed on 1/21/2025 in #help
✅ When should/shouldn't I split off code into a separate lib project?
i'm glad you bring that up, its been bugging me ever since i started working here
76 replies
CC#
Created by LastExceed on 1/21/2025 in #help
✅ When should/shouldn't I split off code into a separate lib project?
I have noticed that only projects with changes get re-compiled, does the compiler do something similar on a per-namespace (per perhaps even per-file) basis?
76 replies
CC#
Created by LastExceed on 1/21/2025 in #help
✅ When should/shouldn't I split off code into a separate lib project?
glad to have that reaffirmed. but out of curiosity, can you elaborate on why/how? like, why do you say you can't do that when at the same time it will technically work ?
76 replies
CC#
Created by LastExceed on 5/2/2024 in #help
✅ how can i let an interface implement a function of a super-interface, instead of shadowing it?
well its an isolated example. my use case isn't that simple of course
24 replies
CC#
Created by LastExceed on 5/2/2024 in #help
✅ how can i let an interface implement a function of a super-interface, instead of shadowing it?
i dont know what it means either xD
24 replies
CC#
Created by LastExceed on 5/2/2024 in #help
✅ how can i let an interface implement a function of a super-interface, instead of shadowing it?
this is exactly what i was looking for, thanks!
24 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
what?
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
in the op
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
but if we move GetList to another project that doesn't use nullables:
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
correct
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
will do
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
coworker and i lost our minds over this yesterday, im on the edge of reporting this as a bug
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
thats not very helpful
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
then why does it give a warning in the first example ?
38 replies
CC#
Created by LastExceed on 6/2/2023 in #help
❔ null warning while indexing (rather than accessing) null-agnostic type?
i know, what about it?
38 replies