Currently I'm using a CoreXT repository and my .sfproj contains the following properties:
<PropertyGroup>
<ProjectVersion>2.5</ProjectVersion>
<MinToolsVersion>1.5</MinToolsVersion>
<SupportedMSBuildNuGetPackageVersion>1.6.9</SupportedMSBuildNuGetPackageVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<PackageLocation>$(ServiceFabricPackageLocation)\$(MsBuildProjectName)</PackageLocation>
<DoNotUpdateNuGetImport>true</DoNotUpdateNuGetImport>
</PropertyGroup>
When I try to load the project in VS 2019 v16.2.0 with Service Fabric SDK v2.5, I get the following error in a pop-up window:
System.MissingMethodException: Method not found: 'Microsoft.VisualStudio.ProjectSystem.IProjectServices Microsoft.VisualStudio.ProjectSystem.IProjectService.get_Services()'.
at Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.ProjectSystem.ConfigureStartupProject.<SetStartupProjectIfNeededUIAsync>d__9.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.ProjectSystem.ConfigureStartupProject.SetStartupProjectIfNeededUIAsync(Hierarchy appHierarchy, IServiceProvider serviceProvider)
at Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.ProjectSystem.ConfigureStartupProject.<>c__DisplayClass8_0.<InitializeAsync>b__0()
at Microsoft.VisualStudio.Shell.UIContext.WhenActivated(Action action)
at Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.ProjectSystem.ConfigureStartupProject.InitializeAsync()
at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.AutoLoadMethodStateMachine.<<StartExecution>b__8_0>d.MoveNext()
Is there some specific version that I should be using of MSBuild, VS or SF to have this project be loaded?
@chiquelo that looks like an issue referencing a VS assembly (Microsoft.VisualStudio.ProjectSystem).
Can you open another VS window and attach a debugger to the devenv.exe process you're opening the Service Fabric project in? Once you've got the debugger attached, open the modules view with Debug > Windows > Modules and search for Microsoft.VisualStudio.ProjectSystem. After you get the error popup in the original VS instance, can you provide a list of the modules (and specific module versions) you see in that list in your debugger instance?
This issue is caused by a side-by-side install of VS 15.9.14 with VS 16.2.0. In 16.2.0, the Service Fabric extension is being installed from a cached version of the 15.9.14 extension, if one was installed previously, which isn't compatible with 6.x releases. We're preparing a fix for this issue for the next available 16.2 servicing release.
As a workaround until a fix is available in an upcoming VS release, you can use the following steps to force VS 2019 16.2.0 to re-download the appropriate extension version:
This should update the package cache with the correct VS 2019 component and install it. You should be able to create and load projects after this.
I'll update this thread once the servicing release with a fix for the issue is available to download.
Running steps 1 and 2 were enough to get me unblocked on this issue. Thank you for the workaround!
VS 2019 16.2.1 is now available (release notes) with a fix for this issue.
We've identified an issue with the VS Installer not removing the bad side-by-side version of the Service Fabric extension when upgrading from 16.2.0, which can result in the old version of the extension still being in the VS extensions folder alongside the new version from 16.2.1 update. There are two workarounds if you are still seeing Method Not Found errors in Service Fabric projects after upgrading from a 16.2.0 install:
The fastest workaround is:
A slower but simpler option is to do a full uninstall and re-install of VS 2019 16.2.1 which will give you a clean installation without the 16.2.0 version of the Service Fabric extension.
@danegsta thanks for your comments. workaround for 16.2 and 16.2.1 both work well.
@danegsta FYI, I had 16.3.4 installed and I still got this problem. your first approach did not work for me, but then removing gramtlyq.e04 folder and run command devenv /UpdateConfiguration worked.
I have 2019 16.3.4 and I do not see the service fabric template when trying to create a new project. I do not have the gramtlyq.e04 folder. I ran the update configuration but still can not see the template. I have removed and added the service fabric tools, I have even done the whole VS repair. I also have VS 2017 and I can see the the service fabric template there.
@vikasm-mittal that sounds like a different problem than the one described in this issue (this error manifests as an error dialog when attempting to create a project from the Service Fabric template, but the template is still present in the new project dialog). I've opened up a new issue #401 to follow up on the problem you're seeing.
It is fixed now, VS installer was not able to update the web.config file in this folder C:Windows\Microsoft.NETFramework64v4.0.30319Config (for others check the installer log for any errors).
After running the installer as administrator it has installed all the cloud related templates including service fabric. I will update the other issue as well. Thanks
I am having this problem with visual studio Version 16.8.3, trying to load a .sfproj file fails and it has "The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found." in the solution explorer.
sorry to bump this after a year, but any ideas @danegsta ?
If I remember correctly this happened to us sometimes, when some members of the team worked with the VS Preview version and then others tried to open it with the regular version. Might be worth checking if you can open it with the Preview version.
I installed "visual studio 2019 Version 16.9.0 Preview 2.0" and still the same error. Does this require a certain version of the service fabric sdk? i currently have version 4.1.428.9550 of the service fabric sdk installed
however, i can open a brand new service fabric project created from the service fabric project template and that works, so i'm not sure why this isn't working.
it could be some issue since its a big mono repo that is using slngen to generate the solution file
Most helpful comment
We've identified an issue with the VS Installer not removing the bad side-by-side version of the Service Fabric extension when upgrading from 16.2.0, which can result in the old version of the extension still being in the VS extensions folder alongside the new version from 16.2.1 update. There are two workarounds if you are still seeing Method Not Found errors in Service Fabric projects after upgrading from a 16.2.0 install:
The fastest workaround is:
A slower but simpler option is to do a full uninstall and re-install of VS 2019 16.2.1 which will give you a clean installation without the 16.2.0 version of the Service Fabric extension.