Econnect Warning: Distributed Transaction was used - microsoft-dynamics

We just moved one of our apps which is a .net windows service to a new 2016 server in a different domain than the Microsoft GP database server is in.
We are using EConnect 14 (GP 2015).
We are getting 1000's of these warning in the application event log, which causes a problem because we use System Center and when it sees all those warnings it is spiking the CPU to process them. They don't stop until we restart our windows service.
Here is the warning.
Distributed Transaction was used
This could be caused by new connection strings used within each xml document, but reusing the base transaction scope.
Configuration Setting 'ReuseBaseTransaction' is by default FALSE. Remove this configuration setting, or set it to FALSE if this was not the expected behavior.
i've tried adding this into the econnect service config and my apps config, tried setting it to false, tried true as well and the warning persists.
<appSettings>
<add key="ReuseBaseTransaction" value="false"/>
</appSettings>
We are using the econnect windows service, we are not bypassing the proxy and going directly to the stored procs.
Do you have any idea how to prevent this warning. I really don't care if the transaction is distributed or not. I found this related article but it offers no solution.
https://dynamicsgpland.blogspot.com/2010/09/econnect-2010-fills-event-log-with.html
as well as this one.
https://community.dynamics.com/gp/b/gpdynland/archive/2010/09/23/econnect-2010-fills-event-log-with-warning-34-distributed-transaction-was-used-34
-Randy

There is a flag in the eConnect API that you can configure in your app.config in order to disable the logging of these promotions.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="LogDtcPromotions" value="false"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

Related

Handler has a bad module "WebSocketModule" in its module list

On 64-bit Windows 10 and IIS 10, I am trying to develop and test a native HTTP module that will act as a WebSockets handler mapping for a specific set of script files. This is all in native C++ starting with RegisterModule(). I am not using any part of ASP.NET.
When I access a URL that should invoke the handler, I receive this response:
HTTP Error 500.21 - Internal Server Error
Handler "QuadooWebSocket" has a bad module "WebSocketModule" in its module list
Detailed Error Information:
Module IIS Web Core
Notification ExecuteRequestHandler
Handler QuadooWebSocket
Error Code 0x8007000d
More Information:
IIS core does not recognize the module.
I used the IIS Manager to setup the handler mapping, and it created an entry in the applicationHost.config file.
<handlers accessPolicy="Read, Script">
<other_modules />
<add name="QuadooWebSocket" path="*.qws" verb="*" modules="WebSocketModule" scriptProcessor="E:\dev\projects\trunk\target\debug\ActiveQuadoo.dll" resourceType="File" preCondition="bitness32" />
</handlers>
Before that, I installed support for WebSockets using the "Windows Features" control panel, and it also added a line to the applicationHost.config file.
<globalModules>
<other_modules />
<add name="WebSocketModule" image="%windir%\System32\inetsrv\iiswsock.dll" />
</globalModules>
When I attach Visual Studio to w3wp.exe, none of the breakpoints in my code are resolved. RegisterModule() is not being called. DllMain() isn't even being called. My module also implements IActiveScript, and IIS does load my module for classic ASP requests.
My code is being built into a 32-bit module, and I have enable32BitAppOnWin64="true" in the applicationHost.config file. This works for the Classic ActiveScript/ASP environment, but does this setting also work when using code that is expected to be loaded via the RegisterModule() export? If that's not the issue, then are there other steps needed to enable a native HTTP module for WebSockets?
Thanks!
After nearly two years, I decided to spend the past few days working on this again, and it's finally working!
To answer the 32-bit question... Yes, IIS can run a 32-bit WebSockets handler on a 64-bit OS.
As to why it's working now... I did rerun APPCMD.EXE again, and I poked around in the configuration until it looked like this:
<globalModules>
...
<add name="WebSocketModule" image="%windir%\System32\inetsrv\iiswsock.dll" />
<add name="WebSocketModule32" image="%windir%\SysWOW64\inetsrv\iiswsock.dll" />
<add name="QuadooWebSocket" image="E:\dev\projects\trunk\target\debug\ActiveQuadoo.dll" />
</globalModules>
<handlers accessPolicy="Read, Script">
...
<add name="QuadooWebSocket" path="*.qws" verb="*" modules="WebSocketModule32" scriptProcessor="E:\dev\projects\trunk\target\debug\ActiveQuadoo.dll" resourceType="File" preCondition="bitness32" />
...
</handlers>
<location path="Default Web Site">
<system.webServer>
<handlers>
<remove name="QuadooWebSocket" />
<add name="QuadooWebSocket" path="*.qws" verb="*" modules="QuadooWebSocket" scriptProcessor="E:\dev\projects\trunk\target\debug\ActiveQuadoo.dll" resourceType="File" requireAccess="Script" preCondition="bitness32" />
</handlers>
</system.webServer>
</location>
One difference is that my handler is now registered with the WebSocketModule32 module.
I could end the answer there, but after my handler was finally loaded, there were a number of issues that I had to work out before it actually worked correctly. Some of what I've learned might be useful to others.
Since I'm handling WebSockets asynchronously, I needed to return RQ_NOTIFICATION_PENDING from OnExecuteRequestHandler(). Otherwise, IIS immediately closed the connection.
When switching to WebSockets, this was the order I ended up using:
Set the module context.
Set the response status to 101.
Load my script VM.
Write headers (e.g. Sec-WebSocket-Protocol).
Flush() asynchronously.
If Flush() does not complete immediately, then it will be completed with a call to OnAsyncCompletion(). If it does complete immediately, use the same code path that would be called from OnAsyncCompletion() and do the following:
Get the named context for IIS_WEBSOCKET.
Cast the context to an IWebSocketContext pointer.
Start the asynchronous reader loop.
Return RQ_NOTIFICATION_PENDING.
After receiving the closing event from ReadFragment(), I call IndicateCompletion(RQ_NOTIFICATION_FINISH_REQUEST) to notify IIS that I am done with the connection. Before I added that, IIS wasn't calling my handler's CleanupStoredContext() method.

publishing fresh project on IIS

I have created new project web.net core without doing any changes and use the created default files. I can successfully run this using the debug mode, but if I am going to publish it on IIS it will give me error: HTTP Error 500.19 - Internal Server Error and here is the error details:
The requested page cannot be accessed because the related configuration data for the page is invalid.
Error code:
0x8007000d
I already tried to modify the web.config to point the processPath to my dotnet location but it still have the same error result:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\WebApplication1.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: d4e1dda9-f8ba-4752-883d-43c86faa3c60-->
I am not yet sure if this one is related to my IIS setup configuration. Any suggestion/comments if encountered this. TIA
check that under which application pool identity your site is running.
to check you could follow the below steps:
1)open iis manager.
2)select application pools and select your application pool name from the middle pane.
3)select the advance setting from the action pane.
then assign permission to the site folder.
1)open iis manager, select your site.
2)right-click on-site and select Edit permission.
3)In properties, windows select the security tab-> edit.
4)one pop up window will open in that select add.
5)in select user or group windows type "iusr" in object name text box and click ok and assign full permission.
6)Repeat the above steps and add "iis_iusrs" and "IIS AppPool\" user permission.
7)After doing changes restart the iis server.
You need to install the “ASP.NET Core/.NET Core: Runtime & Hosting Bundle” on to the server.
you could also set load user profile to true in iis application pool advance setting.
please refer this below link for more detail:
ASP.Net Core Publish: HTTP Error 500.19 - Internal Server Error
500.19 error or 502.5 error when hosting asp.net core 2 application inside IIS

ASP.NET Core 2.0 how to increase IIS Express request timeout in launchSettings.json

I have an ASP.NET Core 2.0 API that I am trying to debug using VS2017 / IIS Express on my local Win10 dev computer and I am running into an issue with IIS Express in that it is hitting the response timeout default of 2 minutes before my process can complete in my API, thus returning a 502.3 - Bad Gateway message.
I process continues to run in my API and completes after 3 minutes and 50 seconds. So, I need to increase the request timeout for IIS Express.
Most of the examples I have found on the web talk about using the web.config, for example;
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore requestTimeout="00:20:00" processPath="dotnet" arguments=".\MyAPI.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
... but from what I understand, An ASP.NET Core 2.0 API running on the local IIS Express doesn't uses a web.config from my project bt rather, it relies on launchSettings.json in the project. However, I have not been able to find anything on the web that talks about launchSettings having any settings values for increasing default timeouts.
Just to confirm, I tried putting a web.config file, like what I listed above, in my project's wwwroot folder, but it made no difference. This worked on my deployed solution in Azure (see related Stack Overflow post) but doesn't in IIS Express on my local dev.
This seems like it should be a simple task but so far I have not had any luck finding a solution.
Any ideas?
EDIT 5/27/18 - SOLUTION
IIS Express with ASP.NET Core 2.0 uses a file similar to a web.config called applicationhost.config, which is located in the project root/.vs/config folder. This file has a
<configuration><Location> ... <location</configuration>
section similar to what I have listed below. This section has the
<aspNetCore ... />
node where I was able to apply the requestTimeout value. By setting that, my dev system was able to get past the default 2 minute timeout.
<location path="MyAPI">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<httpCompression>
<dynamicCompression>
<add mimeType="text/event-stream" enabled="false" />
</dynamicCompression>
</httpCompression>
<aspNetCore requestTimeout="00:20:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" forwardWindowsAuthToken="false" stdoutLogEnabled="false" />
</system.webServer>
</location>
You misunderstood the concepts.
launchSettings.json is only used by Visual Studio to determine how to run your web project. (More info in my blog post)
IIS Express still relies on web.config to read the settings, as that's the only file it understands.

Webservice .Net 4.0 publishing problems in IIS7

I cant get my Webservice published, it should be simple:
I create the app in the IIS,
place it as a 4.0 Classic .Net
I publish it from .Net Solution within VS2012 Right click and publish
on the Webservice project.
The files are placed and it should show by itself on the browser on the URL of the server specified.
But I stumbled upon the following problems:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
So I've looked for It and found this two options:
Option 1:
http://www.banmanpro.com/support2/Requested_Content_Appears_to_be_Script.asp
This one says I should go to Integrated, instead of Classic App Pool. but it's like if I changed a problem for another because now it says:
HTTP Error 500.21 - Internal Server Error
Handler "WebServiceHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
When I go to the web config see what is this error talking about I see no handler tag!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<compilation targetFramework="4.0" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
</configuration>
Should I add one? If so, how?
Option 2:
Script not served by static file handler on IIS7.5
Basically it says I shoud do a aspnet_regiis -i, but when I try
going to %windir%\Microsoft.NET\Framework\v4.0.30319
Even when the folder exists, There is no aspnet_regiis!!
I've only found the aspnet_regiis on the 2.0 Fwk =(
Is that normal?
The handler tag wasn't the answer, however, both options drove me to look for the missing aspnet_regiis of fwk 4.
There was no aspnet_regiis because the full fwk 4.0 wasn't actually installed on a first place.
I had installed on the server the Framework 4 Client Profile and the debugger, which isn't the full version. From now on, whenever I think I have fwk 4 installed, I'll check twice.
After installing it, on Framework 4.0 Classic Pipeline Mode (instead of Integrated) made it work just fine.
But Attention!
After installing the framework, IIS will change the default pipeline to 4.0, that means, if you had ongoing a web(site/service) on 2.0 it will automatically stop working. (It happened to me)

How to report progress of a web service on windows mobile client?

I have tried to implement progress reporting using a soap extension as described at the following links:
stackoverflow
codeproject
However, my "ProgressUpdate" method is not being called, and I believe that is because I haven't got an app.config file in my Windows Mobile project to tell the web service calls to be processed by the SOAP Extension. How can do it in Windows Mobile? This is the sample config file used in the article:
<?xmlversion="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<webServices>
<soapExtensionTypes> <add
type="SoapExtensionLib.ProgressExtension, SoapExtensionLib"
priority="1" group="High" />
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>
I figured out how to do this by adding a custom attribute to the method inside the generated proxy class. The custom attribute is derived from SoapExtensionAttribute.
I got the information at MSDN
Problem now is that I have to remember to add the attribute back in if I refresh the web service reference..............