How do you configure Elmah to tweet error messages? - elmah

I read that Elmah can tweet error messages so I tried to set it up, but could not get it to work. I am able to get it to save the errors into a database and email me the error, but the tweet doesn't seem to work.
Here is my configuration:
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
<section name="errorTweet" requirePermission="false" type="Elmah.ErrorTweetSectionHandler, Elmah"/>
</sectionGroup>
</configSections>
<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.SqlServerCompactErrorLog, Elmah" connectionStringName="LoggingDB" />
<errorTweet
userName="twitter_username"
password="twitter_password" statusFormat="{Message}" />
</elmah>
<system.webServer>
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah" preCondition="managedHandler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
No errors occur, the tweet just does not appear even though it's logged in the database and emailed.

See the ErrorHowling wiki on the project's site for some background and information on ErrorTweetModule and its use.

Related

How to run multiple django applications on IIS server?

I am new in django that runs on IIS server. I have manage to set up server that one django application/site is runnging..now I want to add another django application/site to this server. I cant find anywhere the sample web.config how to do that..
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".apk" mimeType="application/vnd.android.package-archive" />
<mimeMap fileExtension=".config" mimeType="application/xml" />
<mimeMap fileExtension=".pdb" mimeType="application/octet-stream" />
</staticContent>
<handlers>
<add name="Python FastCGI"
path="/page1/*"
verb="*"
modules="FastCgiModule"
scriptProcessor="c:\python27\python.exe|c:\python27\lib\site-packages\wfastcgi.pyc"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
</system.webServer>
<appSettings>
<add key="WSGI_HANDLER" value="page1.wsgi.application" />
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\page1" />
<add key="DJANGO_SETTINGS_MODULE" value="page1.settings" />
</appSettings>
</configuration>`
This is my config so far, how can I add another django site that will be available on URL/page2/ ?
To create a new site click on the server name and add a new website.
enter your site folder path and binding detail.
and copy your old web.config file to the new create site folder and make changes that you want.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".apk" mimeType="application/vnd.android.package-archive" />
<mimeMap fileExtension=".config" mimeType="application/xml" />
<mimeMap fileExtension=".pdb" mimeType="application/octet-stream" />
</staticContent>
<handlers>
<add name="Python FastCGI"
path="/page2/*"
verb="*"
modules="FastCgiModule"
scriptProcessor="c:\python27\python.exe|c:\python27\lib\site-packages\wfastcgi.pyc"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
</system.webServer>
<appSettings>
<add key="WSGI_HANDLER" value="page2.wsgi.application" />
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\page2" />
<add key="DJANGO_SETTINGS_MODULE" value="page1.settings" />
</appSettings>
</configuration>
Note: use python version after 3.6 with iis if possible.

Nuget Server Repository - Page not found 404

I'm totally desperate. I've been trying to install Nuget.Server v3.2.1.0 for two days now.
I followed the installation instructions at https://learn.microsoft.com/de-de/nuget/hosting-packages/nuget-server, but it doesn't work.
I suspect that the routing doesn't work properly.
My Web.config looks like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation strict="false" explicit="true" debug="true" targetFramework="4.6" />
<!-- maxRequestLength is specified in Kb -->
<httpRuntime targetFramework="4.6" maxRequestLength="30720" />
</system.web>
<appSettings>
<add key="aspnet:UseHostHeaderForRequestUrl" value="true" />
<add key="requireApiKey" value="true" />
<add key="apiKey" value="MyApiKey" />
<add key="packagesPath" value="D:\TFS-Workspaces\Fachit360\Playground\NuGet Server\NuGet Server\Packages" />
<add key="cacheFileName" value="" />
<add key="allowOverrideExistingPackageOnPush" value="false" />
<add key="ignoreSymbolsPackages" value="true" />
<add key="enableDelisting" value="false" />
<add key="enableFrameworkFiltering" value="false" />
<add key="enableFileSystemMonitoring" value="true" />
<add key="allowRemoteCacheManagement" value="false" />
<add key="initialCacheRebuildAfterSeconds" value="15" />
<add key="cacheRebuildFrequencyInMinutes" value="60" />
</appSettings>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
</compilers>
</system.codedom>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<remove name="WebDAV" />
</handlers>
<staticContent>
<remove fileExtension=".nupkg"/>
<mimeMap fileExtension=".nupkg" mimeType="application/zip" />
</staticContent>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="31457280" />
</requestFiltering>
</security>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
...
</assemblyBinding>
</runtime>
</configuration>
And here is my development environment:
- Visual Studio 2017 Pro (15.9.12)
- Windows 10 Enterprise LTSC
- IIS Express 10.0 (Visual Studio integrated)
The installation is very simple. The overview page is also displayed:
What I find confusing is that the Default.aspx file contains the following:
Click here to view your packages.
And in the file NuGetODataConfig.cs the following is configured:
NuGetV2WebApiEnabler.UseNuGetV2WebApiFeed(
config,
"NuGetDefault,
"nuget"
"PackagesOData,
enableLegacyPushRoute: true);
Anyway, when I click on "Click here to view your packages", I get the error: "Page not found - 404".
Does anyone have an idea why that might be? I am at the end of my Latin.
Many greetings
Update
I forgot to mention that I also tried to release the project on a Windows Server 2012 R2. Exactly the same problem.
And it's strange that you can find the following packages in my project references:
- Nuget.Core
- Nuget.server
- Nuget.Server.Core
- Nuget.Server.V2
Then why does the start page talk about Nuget.Server 3.2.1.0?

ASP proper config to allow CORS in a asmx webservice for POST requests

I´m trying to setup a server capable to handle CORS, but also capable to return the response in json format.
Tried with various config schemes, but no luck.
I need to do my Ajax requests via POST. With my actual config i´m able to do requests via GET, but currently my response always is encapsulated in XML format.
As stated in ResponseFormat.Json returns xml , my requests must be 'application/json' but when I try to do it in this way I'm receiving a preflight message (Response for preflight has invalid HTTP status code 404).
My web.config (allowing CORS via GET) currently is:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5.2">
<assemblies>
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<!--<add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>-->
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
</assemblies>
</compilation>
<httpRuntime />
<pages controlRenderingCompatibilityVersion="4.0" />
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
</httpHandlers>
<sessionState timeout="30"></sessionState>
<webServices>
<protocols>
<add name="HttpGet" />
<add name="HttpPost" />
</protocols>
</webServices>
</system.web>
<appSettings>
<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" />
</appSettings>
<connectionStrings>
<....>
</connectionStrings>
<system.webServer>
<handlers>
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /></handlers>
<validation validateIntegratedModeConfiguration="false" />
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="X-Requested-With, Content-Type" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
I´m using iron-polymer for the Ajax-requests and combined various content-types. Currently i´m getting my data via GET using 'content-type="application/x-www-form-urlencoded; charset=UTF-8" handle-as="document"'.
I´m having difficulties to process the response due such XML encapsulation. Below are two examples of received responses. How to extract the contents ?
1:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://my.domain/">EF7B48E346BC537F98F9696304CECAFE</string>
2:
'<?xml version="1.0" encoding="utf-8"?>
<ArrayOfCiudad xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://my.domain/">
<Ciudad>
<Codigo>32</Codigo>
<Nombre>BOGOTA</Nombre>
<CodigoDepartamento>Z03</CodigoDepartamento>
</Ciudad>
<Ciudad>
<Codigo>133</Codigo>
<Nombre>CALI</Nombre>
<CodigoDepartamento>Z01</CodigoDepartamento>
</Ciudad>
<Ciudad>
<Codigo>53</Codigo>
<Nombre>CARTAGENA</Nombre>
<CodigoDepartamento>Z13</CodigoDepartamento>
</Ciudad>
<Ciudad>
<Codigo>30</Codigo>
<Nombre>MEDELLIN</Nombre>
<CodigoDepartamento>Z04</CodigoDepartamento>
</Ciudad>
</ArrayOfCiudad>'

InsufficientMemoryException in Appfabric

**InsufficientMemoryException in Appfabric.
System.InsufficientMemoryException: Failed to allocate a managed memory buffer of 268435456 bytes. The amount of available memory may be low. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Ram size was-32gb. After I set maxBufferSize="999999999", but still I am getting the same error. My configuration file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataCache" type="Microsoft.ApplicationServer.Caching.DataCacheSection, Microsoft.ApplicationServer.Caching.Core" />
</configSections>
<dataCache size="Small">
<caches>
<cache consistency="StrongConsistency" name="default" minSecondaries="0">
<policy>
<eviction type="Lru" />
<expiration defaultTTL="10" isExpirable="true" />
</policy>
</cache>
</caches>
<hosts>
<host replicationPort="22236" arbitrationPort="22235" clusterPort="22234"
hostId="1222497344" size="16383" leadHost="true" account="XXX"
cacheHostName="AppFabricCachingService" name="XXX.com"
cachePort="22233" />
</hosts>
<advancedProperties>
<securityProperties mode="None" protectionLevel="None">
<authorization>
<allow users="Anblicks" />
<allow users="DefaultAppPool" />
<allow users="Administrator" />
<allow users="network service" />
</authorization>
</securityProperties>
<transportProperties maxBufferSize="999999999" />
</advancedProperties>
<deploymentSettings>
<deploymentMode value="RoutingClient" />
</deploymentSettings>
</dataCache>
</configuration>

Required dependency of type Elmah.Mvc.ElmahController could not be resolved

Elmah is logging errors properly to my database but I can't get to /elmah. What am I missing? This was working without ever implementing a controller for Elmah, but now it's not working. This is following a git merge. All configuration has been reset to how it was working before.
<system.web>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
<appSettings>
<add key="elmah.mvc.disableHandler" value="false" />
<add key="elmah.mvc.disableHandleErrorFilter" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="false" />
<add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
<add key="elmah.mvc.allowedRoles" value="*" />
<add key="elmah.mvc.allowedUsers" value="admin" />
<add key="elmah.mvc.route" value="elmah" />
</appSettings>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="[MyCSName]" />
</elmah>
</system.webServer>
I realise this is an old question but it was the top google search result.
Another option if you want to continue using Funq is pass the additional assemblies you want scanned to funq.
Change
new ServiceStack.Mvc.FunqControllerFactory(container);
To
new FunqControllerFactory(container, typeof(ElmahLogger).GetAssembly(), typeof(ElmahController).GetAssembly())
I am also using ServiceStack, this is what worked for me:
ControllerBuilder.Current.SetControllerFactory(new FunqControllerFactory(container,
typeof (ElmahController).Assembly));
This most likely happens because you are using ServiceStack Funq IOC.
In App_Start\AppHost.cs (name may varies), try commenting out this line:
//Set MVC to use the same Funq IOC as ServiceStack
//ControllerBuilder.Current.SetControllerFactory(new ServiceStack.Mvc.FunqControllerFactory(container));
Regards.