How to deploy ABP to IIS - deployment

I have a ABP template. It is a merged solution for Angular in Full .Net framework. I have already created a published package by right clicking on the Web.Host project and then Publish.
Here is a screenshot of my published folder:
I have also added a website in my local IIS and have pointed it to the wwwroot folder of my published folder as localhost:8081
I have modified the appconfig.json in the wwwroot/assets folder as:
{
"remoteServiceBaseUrl": "http://localhost:8081",
"appBaseUrl": "http://localhost:8081"
}
and have also changed appsettings.json to
"App": {
"ServerRootAddress": "http://localhost:8081/",
"ClientRootAddress": "http://localhost:8081/",
"CorsOrigins": "http://localhost:8081,http://localhost:8081"
},
Do I need to add another Website in IIS for host? If Yes, where should I point it to? Again wwwroot? All the DLLs and appsettings.json are above the wwwroot. Should I bring them all inside the wwwroot?
When I navigate to the localhost:8081 I get "Resource not found" prompt
I noticed that there is a Web.Host.exe file in the Published folder. When change all above settings to localhost:5000 and execute it, it runs the host on localhost:5000 and works fine for both localhost:5000/swagger and localhost:5000/app/
Do I need a website under IIS to execute the Web.Host.exe? If yes, how would I add such website? Where that port 5000 has been set for the .exe file?
If I change the website physical folder to the published folder (which holds the wwwroot folder) I get the following error (seems something is wrong with the web.config file):

You need the .NET Core Hosting Bundle.
Install the .NET Core Hosting Bundle on the hosting system. ...
a. Navigate to the .NET All Downloads page.
b. Select the latest non-preview .NET Core runtime from the list (.NET Core > Runtime > .NET Core Runtime x.y.z). ...
c. On the .NET Core runtime download page under Windows, select the Hosting Bundle Installer link to download the .NET Core Hosting Bundle.
...
Restart the system or execute net stop was /y followed by net start w3svc from a command prompt. Restarting IIS picks up a change to the system PATH made by the installer.
Reference: https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x

Related

IIS Express not working on vs code "Unable to start iisexpress"

IIS Express Extension not starting and can't launch Asp Net app.
I enabled IIS in 'Turn Windows features on or off'
Installed IIS 10 Express
Installed VS Code IIS Express Extension
Tried reinstalling IIS Express and the extension. Still getting the same error.
Do you have a Program.cs file within your Asp Net app? That is typically where .NET looks to find everything to start running.
I enabled IIS in 'Turn Windows features on or off'
Here you installed IIS, not IIS express. IIS Express is equivalent to a stripped-down version of IIS, which has almost all the functions of IIS, but it has no visual management interface, and all management operations are performed by modifying configuration files.
Download IIS Express from this link and install on the developer PC.
After installation, the IIS Express configuration files will be available in "Documents\IISExpress\config" and the IIS Express executable files will be available in the installation directory. For example: C:\Program Files\IIS Express; Set the environment variable path to "C:\Program Files\IIS Express". (Open advanced system settings -> Environment variables -> System Variables -> Path -> Edit ->New -> add the path C:\Program Files\IIS Express). About Using IIS Express, please refer this link.
The specified module could not be found.
For more information about the error, run iisexpress.exe with the tracing switch enabled (/trace:error).
Check if there is an IISExpress\config folder in your home folder. This is a common mistake when configuration files/folders are missing. If the directory does not exist, you will need to create the directory; or the directory may already exist and is just corrupted, you will need to delete the config directory and re-run C:\Program Files (x86)\IIS Express>iisexpress.exe/trace:error

Building/deploying azure webjob with website copies source files instead of binaries/executable

I've added a webjobs sdk project to my existing website. The website runs as an azure app service. I've always done building and deployment by queueing up a new build in visual studio online and deploying from there to my azure website. Recently I created this webjob project in the same solution, that based on this webjobs-list.json generated and put in the website project should cause the webjob to also be deployed with the website during deployment (or so the documentation says). What is happening though is that when it deploys, and I take a look at what is in app_data\jobs\continuous, is not the binaries and executable that I expect, it's the actual source code/project files that have been copied into there. Obviously that isn't going to run, and it shouldn't have thrown source code out there on my website anyway.
I also had to change my release definition in visual studio online to just look for [my website project name].zip, instead of just *.zip, because otherwise I'd get an error from the release indicating: Error: More than one package matched with specified pattern. Please restrain the search patern.
...this appeared to be because the build process not only creates a zip file for my website, it also creates one for the webjobs project. From what I understand and have read, I am supposed to change my release to just look for the website zip file and ignore the other zip file, and just let that get deployed and it should all work fine, but again, what is copied into my jobs folder on the website isn't the binaries or executable for the webjob, it's the actual source files.
How can I get this to deploy just the binaries and executable with the site instead of the source files?
The only other thing I could find to do is remove the webjobs-list.json file from the web project so they are no longer linked together, which causes the build to no longer populate app_data\jobs\continuous with my web job project source files when deployed, and to create an additional task in my release definition to grab and deploy the other zip file that is created during the build (for the webjob project, and it contains the debug files with those binaries for whatever reason). However everything I read tells me that this is not supposed to have to be done, it should just work without me having to do this.
EDIT:
My web project is an MVC 5 project that I created with VS 2013. The web jobs project uses the 2.0.0.0 version of the webjobs sdk.
The build and release definitions, I followed the steps in this article to create:
https://www.visualstudio.com/en-us/docs/build/apps/cd/deploy-webdeploy-webapps
The only additional thing I did after following this article, is in my release definition, I changed the Package or Folder field to look for [my mvc web project name].zip, instead of *.zip, otherwise I'd get the error message noted above.

Generate code from deployed files

I had mistakely deleted my web services code. I don't have any backup of this code. Tried some file recovery tools but it didn't work. I have deployed the project in glass fish 4.0 server and the application works fine from there. So I am thinking is there any way I can generate the codes of that webservice?
Thank you
If you have the application deployed in your glassfish server then it is possible. You can always find your the .class files of original codes (not the one compiled by SEI) inside your domain folder of glassfish. Then you can use some third party tools to generate java codes from the class files. There are to ways that you can deploy your application in the glass fish server:-
By using the glass fish server web GUI and deploy it.
By using exernal IDE like eclipse where you create the glassfish server and deploy it.
For condition 1, goto :-
glassfish\domains\domain1\applications\__internal
where domain1 is your domain name. By default it is the name of your domain
For condition2, goto:-
glassfish4\glassfish\domains\domain1\eclipseApps
where domain1 is your domain name. By default it is the name of your domain
You can find your java codes inside WEB-INF\classes inside your project name.
Hope this helps.

Deploying SQLCE.EntityFramework 4.0.8435.1

I've applied SQLCE in a project I've been working.
It works fine in Visual Studio and when I run locally (http://localhost:####) it runs perfectly.
But when I publish it at my remote host I receive the "Yellow Screen of Death" the following error message:
Failed to find or load the registered .Net Framework Data Provider.
My Web.Config and references are OK (As I said it work fine at localhost) there is no need to chenge it.
The sdf file is deployed in the correct path.
What is missing?
I found the answer.
When SQLCE is installed to your project it add some files and folders under the bin directory of your webapp.
The following files and folders must be deployed along with you app in the bin folder.
Microsoft.Data.Entity.CTP.dll
System.Data.SqlServerCe.dll
System.Data.SqlServerCe.Entity.dll
WebActivator.dll
[x86] (folder)
[x86]\sqlcecompact40.dll
[x86]\sqlceer40EN.dll
[x86]\sqlceme40.dll
[x86]\sqlceqp40.dll
[x86]\sqlcese40.dll
[amd64] (folder)
[amd64]\sqlcecompact40.dll
[amd64]\sqlceer40EN.dll
[amd64]\sqlceme40.dll
[amd64]\sqlceqp40.dll
[amd64]\sqlcese40.dll
The files in the root of the bin folder (the first four I mentioned above) were deployed but for some reason the x86 and amd64 folders were not sent.
After I deployed those files the app worked fine in the remote host also.
The problem is because your remote host does not have the provider for SQLCE. If you look at your connection string it is something like this:
<connectionStrings>
<add name="name"
connectionString="Data Source=|DataDirectory|yourDbFileName.sdf"
providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>
Please note that SQL CE and its System.Data.SqlServerCe.4.0 provider has been released after .Net 4.0 so it was not included in standard .Net framework 4.0. So SqlServerCe.4.0 provider is Missing

deploying asp.net source code to webserver

i am just trying to understand the deployment build model with asp.net
i write code locally on my machine in visual studio and when i hit f5, it starts up a local webserver for all my testing.
then, i FTP all of my source code to my webserver and then hit the real URL.
my question is when does this get compiled on the webserver. is it looking at the bin/ directory of my local file that i just copied over or is it recompiling the solution and projects on the web server.
If you just drop source files (.aspx, .asmx, etc.) in the web site's directory and site is set to allow dynamic updating then each page will get compiled the first time it is accessed.
Every time you update it, it gets recompiled. In your bin folder, all you have is classes with code.