-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Rename items (elements) used in service reference scenarios #7492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Open questions:
|
We talked about how to handle the upgrade from preview3 to 4 with the new names. What we want is for it to fail hard and fast so that customers know straight away to go rename the element. |
Answering open questions:
|
From discussions today:
Bottom line: Use what's there and build on it. |
<ProjectReference include = "..\someproject\someproject.csproj" ReferenceOutputAssembly="false" OpenApiReference="true"/> <ItemGroup>
<!-- Check in the IDE. Not clear what VS does with such a virtual element? -->
<ProjectReference Include="@(OpenApiProjectReference)"
ReferenceOutputAssembly="false"
Exclude="@(ProjectReference)" OpenApiReference="true" />
</ItemGroup>
<!-- Disable in design-time builds? Definitely requires an <Exec/> to generate code. -->
<!-- See https://github.com/dotnet/project-system/blob/master/docs/design-time-builds.md -->
<Target AfterTarget="ResolveProjectReferences" Name="DoWhatIMean">
<!-- May also need to _pick_ a supported Config and not assume web api and client projects share a configuration. -->
<!-- See https://github.com/Microsoft/msbuild/blob/a0817cf07a805ee3f929f19b9336a2d3544cbd84/src/Tasks/Microsoft.Common.CurrentVersion.targets#L1829-L1844 -->
<MSBuild target="GetMeThatStuff"
Project="@(ProjectReference)"
RemoveProperties="TargetFramework;TargetFrameworks;RuntimeIdentifier"
Condition=" '%(OpenApiReference)' == 'true' ">
<Output items="OpenApiReference" />
</MSBuild>
</Target> On the server side, disabling build in old-style (WebApi) projects may require a bit more work. Would need |
@davkean - Do you think adding something like the above would impact the tree node in VS? |
- #7492 - remove document generation from client project; will be included in Web API project infrastructure (coming soon) Also - provide `%(FirstForGenerator)` metadata, #4916 - add `$(OpenApiGenerateAtDesignTime)` property (default `true` for now), #4944 - generate code in `obj` directory by default, #4945
- #7492 - remove document generation from client project; will be included in Web API project infrastructure (coming soon) Also - provide `%(FirstForGenerator)` metadata, #4916 - add `$(OpenApiGenerateAtDesignTime)` property (default `true` for now), #4944 - generate code in `obj` directory by default, #4945
- #7492 - remove document generation from client project; will be included in Web API project infrastructure (coming soon) Also - provide `%(FirstForGenerator)` metadata, #4916 - add `$(OpenApiGenerateAtDesignTime)` property (default `true` for now), #4944 - generate code in `obj` directory by default, #4945
- #7492 - remove document generation from client project; will be included in Web API project infrastructure (coming soon) - adjust eng/ProjectReferences.props to new project name - simplify item de-duplication in `_CreateCompileItemsForServiceFileReferences` target i.e. use `Remove` attribute - also handle `.tsx` files in this target - provide `%(FirstForGenerator)` metadata, #4916 - add `$(OpenApiGenerateAtDesignTime)` property (default `true` for now), #4944 - generate code in `obj` directory by default, #4945 - provide a default `%(CodeGenerator)` value, ##7491 1 of 2 (remainder will come in next milestone) nits: - remove a useless `StringBuilder.Append(...)` call - remove `%(OpenApiProjectReference.SourceProject)` metadata, duplicated `%(OriginalItemSpec)` - be more consistent about using element syntax for item metadata
This is a pivot on what users see in their projects when using service reference features.
Current items are
New elements will be
<ProtobufReference Include="SomeFile" ... />
<OpenApiReference Include="SomeFile" SourceUri="https://SomeUri" ... />
<ProtobufReference Include="../SomeProject/SomeProject.csproj" ... />
The text was updated successfully, but these errors were encountered: