-
Notifications
You must be signed in to change notification settings - Fork 401
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
Improvements in sfproj file format #885
Comments
Can't for the life of me find it... but I am sure I read that one of the SF team said that this was in the works and would cone once better xplat support was released? (Sf on linux?) |
Just to make sure that one important option is not removed. I am changing inide all sfprojs DefaultTargets to "Package". It's very important because I am building multiple Service Fabric Projects as part of one VS Solution. So in the new format I need to enable building packages on CI/CD pipeline easily. |
I was sure that microsoft/service-fabric-issues#194 was about that change, but apparently it only covered services projects and not .sfproj. |
If there's any work being done on the project system, please also consider making it compatible with props and targets from NuGet packages. Right now NuGet doesn't generate a cc @ravipal |
Hi everyone, are there any updates on this? Current sfproj format causes annoying issues like https://github.com/Azure/service-fabric-issues/issues/840 when using ASP.NET Core projects with Fabric. Basically recommended for such projects "dotnet restore" functionality is not available to use now. |
With built-in custom SDK resolution implemented in MSBuild and recent improvements in NuGet APIs, SDK trend has started to gain more traction. @mikkelhegn, @jeffkl, would it be a good idea to include sfproj's SDK in Microsoft/MSBuildSdks repo or in a separate directory under https://github.com/Microsoft/service-fabric/tree/15b6be4/src? |
I would keep your SDK in your own repo since you own and maintain it. Be sure to keep your SDK package as small as possible. Your build logic with tasks and a DLL should still be a NuGet package and your SDK can be a small Sdk.props and Sdk.targets that has a MSBuild will not fully evaluate a project until the SDKs are resolved. If your SDK package is large, project load times will be bad and VS could hang. Packages are cached but the resolver still has to query the NuGet API which queries the disk. NuGet package references are restored more asynchronously so they can be much bigger. |
Still an issue |
Jumping in on the pile here to say that this would improve our workflow a ton. Adding dotnet cli templates would also be hugely beneficial. |
Any word on this one? would love to see it as well. |
Kick - make it happen ! 🥇 |
Get going already :( |
It's 2019 now, any new update for this or plan to support this? |
Or, even this is not officially supported, has someone found ways to make sfproj to support package reference at a minimal? I am asking because then I could leverage default package props and targets from NuGet packages |
Mike here from the VS team, I am the PM for the Service Fabric & Service Fabric Mesh tools in Visual Studio. We will be investigating this request soon, with the hope of supporting the new SDK-based project format for our .sfproj in the future. |
It would be nice, BigMorty. We are in the middle of migrating all our ~300 projects to nuget package reference and it proves to be very good and clean. Then here comes this one with service fabric projects stuck in package.config. It is a bit disappointed to find out. |
That's great news @BigMorty, we've got some custom build targets for sf projects and the nuget integration in the new project system makes that so much easier |
same as @aL3891 , we also have custom build targets to extend the sfproj to generate a deployable package to handle runtime certificate and other environment specific settings, if would be benificial if the new sfproj improvement could also clear document the extensions point in the built-in sfproj targets, to allow customize the ApplicationManifest.xml and ServiceManifest.xml generation. |
Feel free tag me in PRs @BigMorty if you'd like some feedback or other assistance :) |
Thanks Allan! |
Really need this feature! |
Sorry to say but we are currently blocked from supporting SDK-style sfproj by the following issues: |
Also looking for this |
How is dotnet/msbuild#4025 blocking? 'Tis just a performance issue and not a very big one, considering that there is only one sfproj in solution (in most cases I've seen at least). |
Any update on this, please? Is work in progress? Is anything blocking by now? |
The two issues that are blocking this (dotnet/project-system#2491 and |
But then how could the mesh project files use the new sdk style? |
Speaking as another user of Service Fabric, as a stopgap you might want to try using E.g.: (Updated Jan 14)
This seems to work fine in VS 2017, but I've had problems loading such projects under VS 2019 -- just speculating, but maybe a regression in the sfproj plugin to VS? I just get an error "The operation failed as details for project ExampleApp could not be loaded". But it works fine in VS 2017, and works fine in command line builds and ADO YAML build pipelines. We use this with dotnetsdk 3.1.405. |
I should add, the original above generates a warning on every build -- Microsoft.Common.props needs to be imported before Microsoft.VisualStudio.Azure.Fabric.Application.props in order to bring in the ProjectName.*.props files that provide the generated nuget paths. However, Microsoft.VisualStudio.Azure.Fabric.Application.props will unconditionally try to import Microsoft.Common.props a second time. To work around the warning, we manually import the ProjectName.*.props files instead of Microsoft.Common.props and use I've updated the post to reflect the new approach |
@aaronla-ms looks promising. Especially the GeneratePathProperty, I did not know about that one. In my opinion, that is 100 times better than the ../../XX/../packages approach that gets generated by default. Unfortunately, I am not able to get this to work. If I do this in Visual Studio by removing the packages.config and applying your changes, I get a message saying, "The project '..' has incompatible NuGet package installed. Would you like to install the compatible NuGet package?"'; VS2019 then decides to just create the packages.config again and for some reason also bumps the version to 1.7.3. As for building via the CLI (dotnet build) it does not resolve the $(PkgMicrosoft_VisualStudio_Azure_Fabric_MSBuild) variable, making it impossible to resolve the props files. Tested via csproj variant, then this trick works perfectly. Am I missing something? We also use |
Hiya @maxhamulyak , yeah, there might be a few more items you might need -- we have a LOT of workarounds we've accumulated over the years to keep msbuild working for us, and it's not always clear which are needed in each scenario. Here's all I could find that seemed possibly related. Try each setting in turn to see which might fix the issue. We import this file immediately at the top of our project, before the first sfproj import.
|
hey @masnider, do you know who (if anyone) drives this effort from the SF team's end? |
We don't own the project format ourselves, it is driven by VS, so we need an update from @BigMorty and @dbreshears |
Sorry, no updates from my end. There are the same blocking issues in the way. We will continue to monitor their progress. |
Another case to consider. In my solution I tried to migrate from "nuget restore" to "msbuild /t:Restore" but could not. This is happening because of the
So, the |
It looks like you failed to update the import path to Microsoft.VisualStudio.Azure.Fabric.Application.props. If you're using msbuild restore, then your imports need to use the
Have you tried removing that target? Note in my sample adaptation there was no InitialTargets specified. |
@BigMorty and @masnider is this issue being worked on actively? Where a simple It would be really really nice if you could somehow prioritize this in the VS/MSBuild camp so we can get sensible sfproj handling in our CI/CD pipelines. Without building all sort of custom crap the replicates the sfproj concept. |
@masnider doesn't work on the SF team team anymore. @craftyhouse is the PM.
+1. The amount of work doubles: first you need to restore nuget packages differently than for the rest of the project (i.e. .NET Core), then build differently. |
Tagging @sukanyamsft who is the PM For the core runtime to see if we can consider this in planning. |
This issue is not being worked on at this time by the tooling team. |
why not? :-) it almost feels like service fabric isn't a priority anymore to get up to date. |
The CPS-based csproj and vbproj has brought a revolution not only in project system, but also the project file format. For instance:
It would be a wonderful improvement if all default target calls are wrapped into a
ServiceFabric SDK
(with option to override them in infrequent scenarios), so that the template project file will looks like:This will:
ApplicationPackageRoot
,ApplicationParameters
,PublishProfiles
andScripts
directories.DefaultItemExcludes
(that new csproj provides) for this purpose.Microsoft.VisualStudio.Azure.Fabric.MSBuild
.PS: is SF team considering to upstream the MSBuild patches to https://github.com/Microsoft/msbuild, so we are not required to pull
Microsoft.VisualStudio.Azure.Fabric.MSBuild
separately?The text was updated successfully, but these errors were encountered: