INodeServices无法在Azure上运行,但可以在Localhost上运行

时间:2019-04-07 01:05:00

标签: azure asp.net-core inodeservice

我正在使用asp.net core 2.2和INodeServices来实现C#和Node之间的互操作性。问题在于,我的Node调用在开发环境中运行良好,但是一旦将代码推送到Azure App Service,然后执行调用(通过MVC控制器),似乎无法找到要执行的Node代码,并且等待位,它会引发错误。

通过使用Kudu,我发现我的node_modules文件夹以及Node文件夹在部署时不会被复制到发布目录,除非我通过在.csproj文件中设置以下代码来配置它们以进行复制

这似乎并不能解决问题,但由于相关性,我认为我的NodeCode文件夹应部署在我的node_nodules旁边。

感谢您的时间。

截至目前,INodeServices调用在我的开发环境中运行良好,但是一旦部署到Azure,长时间的等待就会失败。

    <Content Include="NodeCode\ePaycoCash.js">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="NodeCode\ePaycoCustomers.js">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="NodeCode\ePaycoPayments.js">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="NodeCode\ePaycoPlans.js">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="NodeCode\ePaycoPSE.js">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="NodeCode\ePaycoSubscriptions.js">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
    <Content Include="NodeCode\ePaycoTokens.js">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content> 
    <Content Include="node_modules\**">
        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
</ItemGroup>`


Update:


under LogFiles/DetailedErrors I found this:

Most likely causes:

IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.

IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Things you can try:

Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.

Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.

Install the .NET Extensibility feature if the request is mapped to a managed handler.

Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.

0 个答案:

没有答案