Skip to content
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

.Net Core 3.1, EF Core 3.1 publishing issues #449

Open
aligneddev opened this issue Mar 2, 2020 · 1 comment
Open

.Net Core 3.1, EF Core 3.1 publishing issues #449

aligneddev opened this issue Mar 2, 2020 · 1 comment
Assignees
Labels
area-SDK Relates to Service Fabric SDK and corresponding tooling support (including VS) area-Tooling Relates to questions or issues related to experience enabled in VS to deploy or manage SF apps status-in-progress Issue is being worked on actively

Comments

@aligneddev
Copy link

I recently had a several day fight with a run-time exception. I lost way too much time on this :-), but have found a work around. I'm not sure if it is the best, but it works.

I'm hoping there is a fix that Microsoft can do to help others avoid the difficulties. I wasn't sure if this is the best place to create the issue. Azure Functions had some similar issues in their repo.

Here's a summary, more details can be found in my blog post

  • Service Fabric OnPremise - version 7.0.457.9590
  • .Net Core 3.1.2 (netcoreapp31)
  • Entity Framework Core 3.1.2
  • Azure DevOps 2019 OnPremise
  • 2 Asp .Net Core 3.1.2 projects for a publisher/subscriber setup

Visual Studio, right-click publish on the .sfproj worked great. The Azure DevOps pipeline release has this run-time exception.

System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on this platform. at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString) at Microsoft.

My Solution
I finally decided to go my own way. I know that dotnet publish got the right dll. I also learned that I couldn’t use dotnet cli to create a SF package. I created a .bat file to have something to run locally quickly. Then I moved that .bat file into the Azure DevOps build and called that. In the future, I may split it back out into separate build tasks.

I have the bat file in the blog post. Notice the steps.

  • use dotnet publish. I’m targeting win10-x64 since that’s the only runtime I need right now
  • use msbuild /t:package to create the needed SF package files
  • copy the dotnet publish into the Service Fabric/Code directories
  • Copy other needed xml files for SF publishing.
@aligneddev
Copy link
Author

It is important to note that the publishing in ADO .Net with the Visual Studio Build task (msbuild /t:packge) works with .Net Core 2.2. I haven't checked the differences in output between msbuild and dotnet publish for the Microsoft.Data.SqlClient.dll

@athinanthny athinanthny added the status-in-progress Issue is being worked on actively label Mar 30, 2020
@craftyhouse craftyhouse added area-SDK Relates to Service Fabric SDK and corresponding tooling support (including VS) area-Tooling Relates to questions or issues related to experience enabled in VS to deploy or manage SF apps labels Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-SDK Relates to Service Fabric SDK and corresponding tooling support (including VS) area-Tooling Relates to questions or issues related to experience enabled in VS to deploy or manage SF apps status-in-progress Issue is being worked on actively
Projects
None yet
Development

No branches or pull requests

4 participants