Service fabric application project not crated properly

Mirko Mijanović 0 Reputation points
2023-03-27T16:47:40.6366667+00:00

Hi I need to set up service fabric for Uni project, and I run into an issue I will try to explain as clearly because I am not sure where does the problem come from:
When I create Service Fabric Application project, VS2022 creates only Service Fabric App within solution explorer, but Service projects are created just with .cs and .csproj files, and no additional SF files. When I try to add project manually to the solution VS gives me error as seen in the second screenshot.

 

When project is created I get this error from Service Fabric Task and suggested fix did not work:
An error occurred attempting to configure NuGet to reference the Service Fabric SDK package location as a package source. To fix this, you can manually add a NuGet package source in the Options window and setting it to the following path: C:\Program Files\Microsoft SDKs\Service Fabric\packages.

 

What can I do to fix this? I tried reinstalling Service Fabric and .NET SDK and some fixes I found online but it didn't help. I am 2 days into fixing this and I am running out of ideas. I will provide more detail about my pc if needed 

f1e25422-b1b4-4bd2-921c-936dce7e6674

Stateless service created alongside project creation

55bb7718-1290-4e12-8e58-63bdebbc5ce3

Error I get when I try to manually add Stateless1.csproj to the solution using Add Existing Project, also in the background is Program.cs and solution explorer

Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
252 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,196 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 18,527 Reputation points Microsoft Employee
    2023-04-11T05:58:36.7966667+00:00

    To fix this error, you can manually add a NuGet package source in the Options window and setting it to the following path: C:\Program Files\Microsoft SDKs\Service Fabric\packages.

    After adding the package source, you should be able to add Service Fabric projects to your solution without any issues. If you are still having trouble, you may want to try repairing your Visual Studio installation or reinstalling the Service Fabric SDK.

    If this does not work, you can try adding an existing service by right-clicking on the Services node in the Solution Explorer in VS and selecting “Add Existing Service” or add additional services by selecting Add > New Service Fabric Service.

    Let me know the results in the comments and I can investigate further. Comments are the quickest way of notifying the experts.

    0 comments No comments