I have a Xamarin.Forms app. I included an appsettings.json file in the shared project. It is an "embedded resource" and "copy if newer". When I run a Build Pipeline in Azure DevOps, the generated api (for iOS) and apk (for Android) packages do not have appsettings.json. What am I doing wrong?
Related
Just wondering about the white picture after deploying my app to itunesconnect.
After renaming the .ipa file to .zip and browsing through it it noticed that .net has not include an itunesartwork... file. Only the appicon and my icons for the tabbar included.
I created the .ipa with the terminal command:
dotnet publish -f:net7.0-ios -c:Release /p:ArchiveOnBuild=true
Did i miss something? Is there an optional parameter to force Visual Studio 2022 to create that 1024x1024 graphic?
If i look in the iossimulator folder for that app it includes all the graphics, and i think the file appiconItunesArtwork.png is the important one?
I'm trying to host a ASP.NET Core RazorPages project in Azure App Service.
As an example I've created a new project and that's the app I want to publish.
At first: the publish function from VS2019 (CE) failed with an exception. It is a common exception and I'm not investigate more time in in.
So I thought: I publish it using the portal. So i have a Free account of Azure, create a Resource Group, a Hosting Plan and a Web App. Then i've upload my website using OneDrive and that works.
I've add the ASP.NET Core 3.1 (x86) Runtime to the extensions and the stack is .NET Core (32 bit, because of free plan). I've build the app also for x86.
But the application doesn't work. When I add a default Index.html to the application it works (but not the Razor Pages).
Who can solve this problem??
Regards
Donovan
Looks like you copied too many files to your App Service. The bin/debug and/or bin/release folders should not be there. You need to prepare the website for deployment. In Visual Studio, you can do so by doing a right-click on the ASP.NET project and selecting 'Publish'. On the page that opens, configure a local publish to a folder. The contents of that folder should then be copied to the App Service.
For more information, see Deploy an app to a local folder using Visual Studio.
Also interesting: Host and deploy ASP.NET Core
The dotnet publish command compiles app code and copies the files required to run the app into a publish folder. When deploying from Visual Studio, the dotnet publish step occurs automatically before the files are copied to the deployment destination.
Folder contents
The publish folder contains one or more app assembly files, dependencies, and optionally the .NET runtime.
A .NET Core app can be published as self-contained deployment or framework-dependent deployment. If the app is self-contained, the assembly files that contain the .NET runtime are included in the publish folder. If the app is framework-dependent, the .NET runtime files aren't included because the app has a reference to a version of .NET that's installed on the server. The default deployment model is framework-dependent. For more information, see .NET Core application deployment.
In addition to .exe and .dll files, the publish folder for an ASP.NET Core app typically contains configuration files, static assets, and MVC views. For more information, see ASP.NET Core directory structure.
I am having a console application, which is using appsettings.json for holding the configuration values.
In Visual Studio IDE , when I set AlwaysCopy for appsettings.json, it will be copied to the DEBUG folder, as part of BUILD.
But, in .net core, when I run dotnet build, it is not copying appsettings.json to DEBUG folder.
I am already having below xml configuration added to .csproj
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
When I do dotnet publish, it is getting copied to publish folder. But, it is not happening when I do dotnet build. Can you please tell, why it is not happening & what should I do to copy the appsettings.json to DEBUG folder?
Found the answer in another thread is Stackoverflow(The difference between build and publish in VS?). In .NET Core, build & publish are different, as compared to .NET Framework.
Building .NET Framework applications will generate the same files as
Publish. It will create all the dependencies as binaries including
external dependencies(NuGets for instance). So the product of dotnet
build is ready to be transferred to another machine to run
Building .NET Core applications, if the project has third-party
dependencies, such as libraries from NuGet, they're resolved from the
NuGet cache and aren't available with the project's built output.
Therefore the product of dotnet build isn't ready to be transferred to
another machine to run. You need to run Publish to get all 3rd party
dependencies as binaries in output folder.
If we want a file to be part of publish, we need to add below attribute. In build, this file is not copied to the DEBUG/RELEASE folder.
<Content Include="appsettings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
I have a ASP.NET Web Application using MVC5 Razor. I am using VS2017 Team Explorer (Git) for versioning and on push am building my web application within Visual Studio Team Services. After build success I deploy to Microsoft Azure. Everything works as expected except that on Release my set-up and configuration won't publish the App_GlobalResources (containing my resource files for language) and CommonReports (containing my visualized reports from Microsoft.ReportViewer) folders and files.
Folder content
/App_GlobalResources/
- Resource.resx
- Resource.de.resx
/CommonReports/
- CustomerRatingsReport.rdlc
File properties
Resource.resx
Resource.de.resx
CustomerRatingsReport.rdlc
Azure Release Definition
When I publish manually within Visual Studio 2017 (Right-click on file / folder, "Publish ", the files are successfully published to azure and the application works fine.
The files are available within my repository.
How can I automatically publish these files on successful build?
I am trying to Continuous Delivery my ASP.NET WEB API 2 app with Visual Studio Team Services (VSTS).
I created Release with Deploy Azure App Service task with default settings (i changed only Package or Folder field to match my bin\Release folder)
Build and deploy were successful, but nothing changed. When I open DebugConsole/CMD in Diagnostic Console (app-name.scm.azurewebsites.net) I saw that VSO put all binaries to the ...\wwwroot, while Visual Studio puts all binaries to ...\wwwroot\bin folder.
WWWROOT structure with Visual Studio Publish... task
...\wwwroot
Web.Config
Global.asax
packages.config
bin\
*.dll
WWWROOT structure with Visual Studio Online Deploy Azure App Service task
...\wwwroot
Web.Config
Global.asax
packages.config
*.dll
How can I set target folder on deploy?