Error on deploying .Net Core 2.0 Web API to AWS Elastic Beanstalk - amazon-web-services

I have used .Net Core 2.0 to build my Web API. Now I am trying to deploy this project to AWS using its Elastic Beanstalk Service. I am also using the Visual Studios AWS deployment tool.
During the deployment process, I am receiving the following error;
Error during deployment: Could not find a part of the path
'C:\inetpub\AspNetCoreWebApps\app\appsettings.Development.json'.
I have added the following section into my .csproj;
<ItemGroup>
<Content Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
I can see that my appsettings.json and appsettings.Development.json are in my output folder when I build my project. Also they appear in the published directory if I publish the app into my local pc.
I could not understand why does Amazon's service can not pick it up...
Edit: So, interestingly I created a new .Net Core 2.0 Web Api project from Visual Studio templates and tried deploying it to AWS and it gave me the same error. However when I create an MVC project and deploy it to AWS everything works fine. The default settings for the web api template seems to be effecting the deployment somehow...

So I created a new .Net Core 2.0 MVC Project and migrated/adapted my web api to it. Now its deployed without any issues.
So if your project was started from a Web Api template and getting a simillar error, try switching between templates.

So after trial and error with including and excluding certain files, the problem is with WebApi because it does not have a wwwroot folder and it would appear the elastic beanstalk scripts are looking for this.
To make it work, I added a wwwroot folders and put a placeholder html file inside it and my project now deploys correctly!

Are you using AWS toolkit for VS 2017 to deploy your application. That would do a lot of the config work for you.
There are many problems with the AWS preconfigured environment for asp.net core 2 with IIS 10, try terminating your beanstalk environment and recreate and deploy through AWS toolkit directly from Visual Studio. Right click your project and use the "Publish to AWS Beanstalk"

Related

AWS Amplify deployment: ERR_CONNECTION_RESET

I'm deploying my first project to AWS Amplify, it's just a basic React app with some divs and text to test out the deployment.
It builds and runs in VS code and is bound to Git.
I ran thorough the Amplify Console wizard, setting up the build to use Webpack which completed successfully and deployed uploading:
index.html
index.css
main.js
and a couple of images
However when I visit the link I get:
This site can’t be reached
ERR_CONNECTION_RESET
How can I investigate what exactly has been deployed to give me clues to why it won't work?
I has assumed that it was the hosting that was the problem but after testing it with Firefox and IE I got more security related messages.
Finally I got it working on my phone on 4G (bypassing the home router) and this worked.

MSBuild doesn't create a package for a Web Service project?

We're running the following command for building and packaging Visual Studio Solutions:
MSBuild.exe *slnfile* /p:DeployOnBuild=true /p:CreatePackageOnPublish=true
It appears this creates packages for Web Applications but not Web Services. I don't even see a "Publish" option in Visual Studio for Web Service projects. How do I package these for deployment?
It turns out the developer didn't create a Web Application project, they created a simple empty C# project. I converted the project to Web Application and it works.

How to deploy files for Sitecore using TDS

I'm starting a new Sitecore 9 project using Helix and TDS. I've got my basic structure setup, using Hedgehog's fork of the Habitat site as a guide. I'm also referencing Hedgehog's docs.
My solution is just a start, so it's very simple right now, only a Foundation.Serialization module that contains the TDS projects for the basic layer folders and a Project.Website module that contains a TDS project and an MVC Website project (MVC)....it's got a basic Razor view and some random CSS/JS files.
The TDS Habitat readme, says to use Solution > Deploy Solution to deploy the projects. When I do this on my project it builds and the Sitecore items are deployed to Sitecore, but my Views and CSS/JS are not....presumably because I haven't configured anything to facilitate this.
Looking at the docs and the TDS Habitat solution, it's not clear to me how to configure TDS to know anything about how to deploy files. I'm finding info on the web that says that TDS will deploy files, transform configs, etc but with no examples of how to actually make that happen.
How do I set things up so Deploy Solution will also deploy files from all of the web projects in a solution to my local web root?
First, you will need to make sure the Sitecore Deploy Folder is set. From the documentation:
Sitecore Deploy Folder – Contains the path to the ROOT of the Sitecore
instance on the file system. This setting is used to install the TDS
Classic service when needed and to deploy the compiled code when the
TDS Classic project is built.
You also need to make sure that file deployment has not been disabled:
Disable File Deployment – Stops TDS Classic deploying files to the
directory specified in the Sitecore Deploy Folder.
If you are still not seeing the files being deployed, you will need to check if the process has access to the deploy folder.
You can also deploy files as a .update package and then use another automated tool to deploy the .update package to the target environment.
I figured out the issue. On the properties page for a TDS project there is a field where you indicate which projects should be built and deployed along with the sitecore items:
https://www.hhogdev.com/help/tds/propgeneral

Deployment package did not contain an iisApp

I'm trying to upload a zip of files of a published .net project to Amazon elastic beanstalk but it keeps throwing an error in the logs saying iisApp is not there. How to fix?
Elastic Beanstalk expects a WebDeploy package, not just a zipped web application. You'll probably want to run:
msbuild <web.csproj> /t:Package /p:Configuration=Release /p:PackageLocation=<outputdirectory>
to create a WebDeploy package.

How to deploy the Web service in to tomcat 7 from out side of eclipse juno?

i am very new to web services and i have one problem please suggest me .. i.e i have a WSDL(SOAP) file and with that i created the Web Service-server and web service-Client using Top-Down approach with JAX-WS in eclipse Juno Java EE. i integrated the Tomcat 7 with that Eclipse and from eclipse its working fine.
But my problem is i need to run the Tomcat from out side of the eclipse and i need to deploy the web service in to the tomcat. i don't want to run the Tomcat using eclipse? i just need to run the client from eclipse but i dont want to run the tomcat from eclipse. Please Help me.
File -> Export -> Web -> War (configure where to create it)
Deploying a tomcat application consist of building a war file then deploying it. We call this servlet.
Building the WAR
As you already have your server code, you should now complet the WEB-INF/web.xml file. This file describe the path of your servlet(your server code), on the tomcat server. Depending of your framework you can have some configuration to add in your META-INF/context.xml file.
In an eclipse project, thoses file are generaly under a directory name 'webapp' in your project. (src/main/webapp for a maven project).
First you must use the javaee & javaweb tools of eclipse to build a war file that contains all yours libs, files, class and web.xml
Alternativly you can use a maven build process to get a war, if you use maven.
Deploying the war
After installing tomcat, the deployement is as simple as drop the .war file is deploy directory of the home-directory of tomcat. Then your application is usable on default port 8080.
If you have install also the manager webapp of tomcat, you can see all yours currently deployed application in the manager http://myurl:8080/manager/html.
When you install tomcat, let be sure that your eclipse pseudo server is shutdown, or your tomcat server will have problem to get it's port and startup.