Base solution for your next web application
Open Closed

Clarification about ASP.NET CORE publish #4100


User avatar
0
Ricavir created

Hi,

I've published my project (ASP.NET CORE + Angular 4 upon .NET Framework 4.6) on A2Hosting.com within a windows shared server. Application is working fine (database access, SIGNALR, emailing...). That said, I still need to refactore some code on my side to achieve better performance.

Nevertheless, application pages are loading sometimes very slow sometimes faster (taking into account lazy loaded modules managed by angular routing).

I asked A2Hosting support about this page loading and database access differences. They answered that my application was published over FTP in SDC (self-contained deployment) with an EXE output. And EXE application are blocked in their side because of security policy.

Fine to me, but actually my application is targetting .NET Framework 4.6 (mainly because of SIGNALR support). You can have a look to attached screenshot. But the web.config file is mentionning ASP.NET CORE :

<aspNetCore processPath=".\xxx.Web.Host.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />

So the question is : what is the application output type ? ASP.NET CORE or ASP.NET ? Do you use to publish your applications without EXE file ? How can I publish in FDD (framework dependant deployment) if I'm not targetting ASP.NET CORE ?

Currently, I'm using file system deployment with visual studio and transfering generated files over FTP ? Is it also you way of publishing ? I've tried web deploy but I'm having authorization issue... What is your advice ?

Sorry for all these questions, I'm not an expert at all on server mangement and deployment process ; and a little bit lost also ;)


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Ricavir,

    Both .Net 4.6.1 and .Net Core are ASP.NET Core applications. I don't know if it is possible to produce a publish output which is not exe. You can search it on the web.

    If you check OutputType on this document <a class="postlink" href="https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build?tabs=netcore2x">https://docs.microsoft.com/en-us/dotnet ... =netcore2x</a>, it seems like it is not possible.

  • User Avatar
    0
    Ricavir created

    Hi,

    thanks for your answer. I've been hardly working on this issue.

    Actually, you can build a dll as output file instead of EXE (in this case, it is a FDD : framework dependent deployment) You just need to change OutputType from "EXE" to "LIBRARY". All hosting provides will request this kind of deployment for security reasons.

    Right now, I'm trying to find the right config to tell IIS to launch this library instead of old EXE file.

    I'll keep you informed when I will reach my goal ;)

    Cheers

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @Ricavir :),

    I haven't tried it for ASP.NET Core but according to this document <a class="postlink" href="https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build?tabs=netcore2x">https://docs.microsoft.com/en-us/dotnet ... =netcore2x</a>, it says:

    In order to produce a library, omit the <OutputType> property. The main difference in built output is that the IL DLL for a library doesn't contain entry points and can't be executed.

    That is why I thought it is not possible. I will be glad if you can share your experience.

    Thanks.

  • User Avatar
    0
    Ricavir created

    Coming back from the field : After publishing application in FDD way, I tranfered it in FTP to the hosting provider. The library is then runned by ASP.NET CORE installed on shared server.

    Unfortunately, we had some errors :

    • "ErrorCode = 0x80004005 : 80008083."
    • "A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found"

    I didn't found the way to generate hostpolicy.dll.

    This was the main issues but other ones must be managed when hosting on a shared server (file access, some appservices not working...)

    As we want to go fast and don't have more time to spend on it right now, we decided to switch to an Azure plan. The App is now running on Azure like a charm.

    We put this task in our backlog for now and will update this post when we'll have more time. If anyone using aspnetzero have more information on FDD, feel free to share here ;)