Content files are not deployed in the Service Fabric package for asp.net core - azure-service-fabric

I've an asp.net core project with appsettings.json file being copied to the output directory on each build with following "copyToOutput" option in project.json file. When I build it and go to the build folder I can see it. But when I build a Service Fabric application that uses this asp.net core project as service, in package folder, appsettings.json file is missing. Are there any issues with processing content files for asp.net core?

Actually, the problem was related to the fact that there is being called dotnet publish step when creating ASF package. Hence "copyToOutput" was supposed to be done via "publishOptions".

Related

Azure DevOps - Linking Class Library project into the release of another project

Under same ORG, i have 2 projects. One is a class library project. Another one is a web site project. Both have their own build and release definition. I want to include dlls from the class library project when i do a release of the web site project. Web site project uses IIS deployment tasks in it's release. This IIS deployment task deploy the zip file created from the build of the web site project only (this project will have reference of the dll from class library already added). What i need is when the release of web site happen , it should pick the latest dll from class library project added in to it's bin folder. How do i do that in devops release definition.
Azure DevOps - Linking Class Library project into the release of another project
The easiest way is add the class library project in the solution of web site project and set it as project reference instead of reference the dll file.
Then we build the solution of the web site project, the latest dll from class library project will be added in to bin folder of web site project each time when we build the solution.
If you do not want to use project refernce, you can also use the Download Pipeline Artifacts task in the build pipeline of web site project to download the latest dll from class library project, then use the Copy Files task to copy the dll from the default folder to the bin folder.
Hope this helps.

Installing a package which depends on Entity Framework via NuGet

Okay, so I have an internal library for entities, and I have a web application which depends on the library.
So the dependency looks like this:
Web Application
Library
Entity Framework
The library is managed via an internal NuGet feed.
The problem I have is that every time I update the library within the web application, the install.ps1 script gets run for Entity Framework. This creates an EF folder (along with with Model1.tt, Model1.cs, Model1.Context.tt, Model1.Context.cs files) within the web application.
I don't want this obviously, so every time I update the library project, I have to delete files from the web application.
I feel there's something I'm missing here - how do I get to use Entity Framework as a dependency without it creating the EF folder every time I update the library project within the web application?

Is packages.config required in a deployed asp.net mvc solution

I did a build publish to a mvc applications and See that packages.config is also deployed even though i did select "Only files required to run this application" in the properties. Can i safely remove this nuget package list file using wpp targets when deploying ?
Yes you can remove it from the deployed application.
It is used by NuGet to keep a record of what NuGet packages are installed in a particular project.
By default, the build process copies all files from source to the destination directory. To exclude the file, right click the file, select properties and for Build Action choose 'None'.

Cannot load Entity Framework assembly in Azure website - The module was expected to contain an assembly manifest

I have an MVC4 web application running locally using Entity Framework 6. It is running as any CPU. When I deploy to Azure via web deploy the home page loads fine, but when I browse to a page that uses Entity Framework I see:
Could not load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest.
I have tried building / deploying as X64 and x86. I have tried changing the platform mode between 32 and 64 bit in the Azure configure tab. I have tried Integrated and Classic modes. I have tried removing the package and reinstalling via NuGet.
Additionally if I try to run locally as X64 then it gives:
Could not load file or assembly 'ProjectName' or one of its dependencies. An attempt was made to load a program with an incorrect format.
This means it fails on the first page, before even getting to the page that uses Entity Framework.
How do I fix being able to use Entity Framework on Azure websites?
I had this same problem. Using FTP I noticed some unneeded DLLs in my bin folder, so I deleted all the DLLs and republished. That fixed it!

Deploying Entity Framework 5 in production without using Nuget

Using the Nuget package I downloaded and used Entity framework. I created a class library use the Entity framework and another windows forms application that uses the library to create data.
While deploying to production, I used with Windows Forms Application bin content but EntityFramework.dll is not part of it.
My question is :
How to deploy/install the Entity framework into production without using Visual studio/Nuget package?
Appreciate your responses.
If you set the Entity Framwork reference to Copy Local = True, it should deploy into your bin folder when you build the project