Acumatica TestSDK_17_207_0029_18 Failure to generate wrappers - acumatica

I am following the documentation for Part1: General Ledger and Cash Management where you are instructed to run the Classgenerator.exe.
Expected results: Page Wrappers successfully generated
Actual results: System.AppDomainUnloadedException: The application domain in which the thread was running has been unloaded.
I have verified my ClassGenerator.exe.config to be correct.
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="SitePhysicalPath" value="E:\Program Files (x86)\Acumatica ERP\960 Instances\AcumaticaIntegrations"/>
<add key="GenResultPath" value="C:\SDK\ClassGenerator\Out"/>
<add key="Username" value="admin#Company"/>
<add key="Namespace" value="GeneratedWrappers.Acumatica"/>
<add key="ClearOutput" value="true"/>
<add key="FilenameFilter" value="CS100000, CS102000, CM202000, GL201500, CS202000, GL202500, GL102000, GL101000, GL201000"/>
<!--<add key="PagesList" value="list.txt"/>
<add key="PagesListAttribute" value="exclude"/>
<add key="PagesListAttribute" value="include"/>
<add key="PagesParameters" value="ParamsPP.txt"/>
<add key="GenericInquiryParameters" value="ParamsGI.txt"/>-->
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
</startup>
</configuration>
Every time I try to run the class Generator exe I get this error.
C:\Users\jonat\Downloads\TestSDK_17_207_0029_18\ClassGenerator>ClassGenerator.exe
System.AppDomainUnloadedException: The application domain in which the thread was running has been unloaded.
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateInstanceInNewWorkerAppDomain(Type type, String appId, VirtualPath virtualPath, String physicalPath)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost(Type hostType, String virtualDir, String physicalDir)
at ClassGenerator.ScreenExtractor.GetProxy() in E:\Bld\AC-TESTSDK2017R207-JOB1\tests\Selenium\ClassGenerator\ClassGenerator\ScreenExtractor.cs:line 64
at ClassGenerator.ScreenExtractor..ctor(String virtualPath, String sitePhysicalPath, String genResultPath, String username, String namespace, String postfix, Boolean correctCTL01) in E:\Bld\AC-TESTSDK2017R207-JOB1\tests\Selenium\ClassGenerator\ClassGenerator\ScreenExtractor.cs:line 28
at ClassGenerator.ClassGenerator.Run() in E:\Bld\AC-TESTSDK2017R207-JOB1\tests\Selenium\ClassGenerator\ClassGenerator\ClassGenerator.cs:line 177
at ClassGenerator.Launcher.Main(String[] args) in E:\Bld\AC-TESTSDK2017R207-JOB1\tests\Selenium\ClassGenerator\ClassGenerator\Launcher.cs:line 11
Has anyone else encountered this issue? Thank you in advanced.

Related

ArgumentOutOfRangeException on Azure RemoteForwarder Plugin

I currently have an Azure CloudService running and when I check the 'WADDiagnosticInfrastructureLogsTable', there is an error coming out every minute.
The details are as the following.
Exception:
System.ArgumentOutOfRangeException:
Length cannot be less than zero.
Parameter name: lengthServer
stack trace:
at System.String.Substring(Int32 startIndex, Int32 length)
at Microsoft.WindowsAzure.Plugins.RemoteForwarder.RdpRemoteEndpointFinder.GetRemoteEndpoint(Socket clientSocket, Stream peekBuffer)Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.WindowsAzure.Plugins.RemoteForwarder.IRemoteEndpointFinder.GetRemoteEndpoint(Socket clientSocket, Stream peekBuffer)
at Microsoft.WindowsAzure.Plugins.RemoteForwarder.RemoteForwardingService.ClientConnected(Object sender, ConnectionEventArgs e)
at Microsoft.WindowsAzure.Plugins.RemoteForwarder.TcpSocketServer.OnClientConnected(ConnectionEventArgs e)
CloudService Config:
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="*** omitted intentionally ***" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="*** omitted intentionally ***" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2017-11-04T23:59:59.0000000+09:00" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
</ConfigurationSettings>
Azure SDK Version:
v2.9.6
Any one have an idea what's wrong?
Thanks in advance.

Owin Hosted NancyFX app returns Could not load type Nancy.Hosting.Aspnet.NancyHttpRequestHandler once published to IIS

While it works perfectly when run locally through VS Studio's included IIS Express, my application chokes once deployed to IIS 8:
System.Web.HttpException: Could not load type 'Nancy.Hosting.Aspnet.NancyHttpRequestHandler'.
Back-end is MS Owin, written in VB (.NET 4.5), which registers 3 middlewares: OAuth server, JWT bearer Authentication, and Nancy. Front end is AngularJS. The proper DLLs are included in the published directory.
IIS 8 has .NET 4.5 installed and enabled. It is running in integrated mode.
I am not sure if this is related to the configuration of Nancy within web.config or the configuration of IIS. Relevant source follows:
Startup.vb
Public Sub Configuration(app As IAppBuilder)
Dim issuer As String = "http://obscured-domain"
Dim audience As String = "obscured-audience-key"
Dim secret As Byte() = Microsoft.Owin.Security.DataHandler.Encoder.TextEncodings.Base64Url.Decode("obscured-client-secret")
'CORS Configuration
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll)
app.UseOAuthAuthorizationServer(New OAuthAuthorizationServerOptions() With { _
.AllowInsecureHttp = True, _
.TokenEndpointPath = New PathString("/authenticate"), _
.AccessTokenExpireTimeSpan = TimeSpan.FromHours(1), _
.AccessTokenFormat = New JwtFormat(issuer, audience), _
.Provider = New OAuthServerProvider()
})
app.UseJwtBearerAuthentication(New JwtBearerAuthenticationOptions() With { _
.AuthenticationMode = Microsoft.Owin.Security.AuthenticationMode.Active, _
.AllowedAudiences = New String() {audience}, _
.IssuerSecurityTokenProviders = New IIssuerSecurityTokenProvider() { _
New SymmetricKeyIssuerSecurityTokenProvider(issuer, secret)
}
})
'Content service
Dim nOpts As New NancyOptions
nOpts.PassThroughWhenStatusCodesAre(HttpStatusCode.NotFound, HttpStatusCode.InternalServerError)
app.UseNancy(nOpts)
'Handle IIS request pipeline staging
app.UseStageMarker(PipelineStage.MapHandler)
End Sub
Web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<httpHandlers>
<add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
</httpHandlers>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*"/>
</handlers>
</system.webServer>
<connectionStrings>
<add name="FTConnStr" connectionString="obscured-connection-string" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Example Nancy Module
Public Class KnowledgeBaseModule
Inherits NancyModule
'Get page of article briefs via full-text search
MyBase.Get("/api/articles/paged/{offset}/{numRows}") = _
Function(parameters)
Dim searchFields As FullTextFields = Me.Bind(Of FullTextFields)()
Try
Dim results As Dictionary(Of String, List(Of Dictionary(Of String, Object)))
results = FullTextProvider.pagedSearch(searchFields.fields("SearchString"), CInt(parameters.offset), CInt(parameters.numRows))
Return Response.AsJson(results)
Catch ex As Exception
'temp 500
Return HttpStatusCode.InternalServerError
End Try
End Function
Private Class FullTextFields
Public Property fields As Dictionary(Of String, String) = New Dictionary(Of String, String) From _
{
{"SearchString", String.Empty}
}
End Class
End Class
Since you're using OWIN you need to use the SystemWeb host not Nancy's AspNet host. You also need to remove these two parts from your web.config:
<httpHandlers>
<add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
</httpHandlers>
<handlers>
<add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*"/>
</handlers>
You probably have a copy of the nancy host in your bin folder which is why it works locally but not when you deploy it.

Azure: Failed to send bytes to XContainer wad-tracefiles

For some reason I get errors while using Diagnostics in Azure. The code of my (WCF) WebRole is:
public override bool OnStart()
{
// To enable the AzureLocalStorageTraceListner, uncomment relevent section in the web.config
DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
diagnosticConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
diagnosticConfig.Directories.BufferQuotaInMB = 256;
// Start diagnostics
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfig);
// Write trace line
Trace.WriteLine("CUSTUM TRACE MESSAGE");
// Start instance
return base.OnStart();
}
My Web.config file looks like this:
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<system.diagnostics>
<sharedListeners>
<add name="AzureLocalStorage" type="WCFServiceWebRole1.AzureLocalStorageTraceListener, WCFServiceWebRole1"/>
</sharedListeners>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
</sources>
<trace autoflush="true">
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
In the Compute Emulator I see the following error:
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[MonAgentHost] Error: MA EVENT: 2012-06-06T10:01:20.111Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6396
[MonAgentHost] Error: 6624
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\xblobconnection.cpp
[MonAgentHost] Error: XBlobConnection::PutBytesXBlob
[MonAgentHost] Error: 1621
[MonAgentHost] Error: ffffffff80050023
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: Failed to send bytes to XContainer wad-tracefiles
This error repeats several times. The "wad-tracefiles" container is added by the following code in the AzureLocalStorageTraceListener class:
public static DirectoryConfiguration GetLogDirectory()
{
DirectoryConfiguration directory = new DirectoryConfiguration();
directory.Container = "wad-tracefiles";
directory.DirectoryQuotaInMB = 10;
directory.Path = RoleEnvironment.GetLocalResource("WCFServiceWebRole1.svclog").RootPath;
return directory;
}
Why does writing trace messages fails in this scenario? When I look in my Storage with the Azure Storage Explorer the only table I see is the WADDirectoriesTable and not the the WADLogsTable. The "wad-tracefiles" blob does get created but that is not the place where I should find the Trace messages from my code.
Anyone, any idea? Any help is appreciated!
Your first problem is that you haven't used SetCurrentConfiguration() with your GetDefaultInitialConfiguration() to finally save the transfer time and log level. You must use the set of these API as below:
GetDefaultInitialConfiguration()
SetCurrentConfiguration()
OR
GetCurrentConfiguration()
SetCurrentConfiguration()
Because of it the following line based configuration will not be saved in Diagnostics configuration:
diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
Use above suggestion and then see what happens.
I would also suggest to just create a very simple web or worker role hello world sample and add general TRACE Message by enabling Azure Diagnostics to see if that give you any error. This will prove if you have any issue with your SDK installation or Azure Storage Emulator or not as well.
Thank you for your reply! The project I am using is a really simple WebRole with only one trace message so I can not strip any code out.
I tried your suggestion and you are right, I do not get any error messages anymore with the following code:
public override bool OnStart()
{
setDiagnostics();
Trace.WriteLine("CUSTUM TRACE MESSAGE");
// Start instance
return base.OnStart();
}
private void setDiagnostics()
{
// Get diagnostics connectionstring
string wadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(wadConnectionString));
// Get the diagnostics configuration of the deployment and its role instances that are currently running
DeploymentDiagnosticManager deploymentDiagnosticManager = new DeploymentDiagnosticManager(cloudStorageAccount, RoleEnvironment.DeploymentId);
RoleInstanceDiagnosticManager roleInstanceDiagnosticManager = cloudStorageAccount.CreateRoleInstanceDiagnosticManager(
RoleEnvironment.DeploymentId,
RoleEnvironment.CurrentRoleInstance.Role.Name,
RoleEnvironment.CurrentRoleInstance.Id);
// Load diagnostics configuration
DiagnosticMonitorConfiguration diagConfig = roleInstanceDiagnosticManager.GetCurrentConfiguration();
// Get the default value if there is no config yet
if (diagConfig == null)
diagConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
// Enable EventLogs
diagConfig.WindowsEventLog.DataSources.Add("Application!*");
diagConfig.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D);
diagConfig.WindowsEventLog.BufferQuotaInMB = 128;
// Failed Request Logs
diagConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
diagConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D);
diagConfig.Directories.BufferQuotaInMB = 128;
// Crash Dumps
CrashDumps.EnableCollection(true);
// Set new configuration
roleInstanceDiagnosticManager.SetCurrentConfiguration(diagConfig);
// Start the DiagnosticMonitor
DiagnosticMonitor.Start(wadConnectionString, diagConfig);
}
When I look in which tables are present in the Azure Storage Explorer I only see the "WADDirectoriesTable" and the "WADWindowsEventLogsTable". Trace messages should come in the "WADLogsTable" right? So I see the Trace message in the Compute Emulator but I do not see them in my storage... any ideas why?

How to configure logging in Spring.NET using log4net?

I would like use from Spring.NET Aspect library Logging aspect together with log4Net.
I found this article how to use log4Net with Common Logging API.
My test application is console and based on .NET 4.0 Client profile.
1st Attempt
So I refer in my project these libraries:
Spring.Core version 1.3.2.40943, runtime v4.0.30319
Spring.AOP version 1.3.2.40943, runtime v4.0.30319
Common.Logging version: 1.2.0.0, runtime v1.0.3705
Assemblies above I have from Program Files\Spring.NET 1.3.2\bin\net\4.0
log4net version: 1.2.10.0, runtime v2.0.50727
I couldn’t find assembly Common.Logging.Log4Net.dll in Program Files\Spring.NET 1.3.2\bin
\net\4.0 so I download this assembly from SourceForge:
Common.Logging.Log4Net version 2.0.0.0 runtime v2.0.50727
I configured logger in app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
</sectionGroup>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="ConsoleAppender" />
</root>
<logger name="myLogger">
<level value="DEBUG" />
</logger>
</log4net>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
</objects>
</spring>
</configuration>
and tried this:
ILog log = LogManager.GetLogger("myLogger");
log.Error("hello world");
I got this runtime error:
{"Could not configure Common.Logging from configuration section
'common/logging'."}
Inner exception:
{"An error occurred creating the configuration section handler for
common/logging: Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net' (E:\C#
PROJECTS\STUDY\SPRING.NET\SpringNet.Aspects\LoggingWithLog4Net\bin\Debug\LoggingWithLog4Net.vshost.exe.Config
line 18)"}
StackTrace:
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[]
keys, SectionInput input, Boolean isTrusted, FactoryRecord
factoryRecord, SectionRecord sectionRecord, Object parentResult) at
System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord
factoryRecord, SectionRecord sectionRecord, Object parentResult,
Boolean getLkg, Boolean getRuntimeObject, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSection(String
configKey) at
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String
sectionName) at
System.Configuration.ConfigurationManager.GetSection(String
sectionName) at
System.Configuration.ConfigurationSettings.GetConfig(String
sectionName) at
Common.Logging.ConfigurationReader.GetSection(String sectionName)
at Common.Logging.LogManager.BuildLoggerFactoryAdapter()
2nd Attempt
I think problem must be in version of assembly Common.Logging.Log4Net version 2.0.0.0 runtime v2.0.50727. Because I used Common.Logging version: 1.2.0.0, runtime v1.0.3705.
So I changed Common.Logging version from 1.2.0.0 to 2.0.0.0. I used Common.Logging from SourceForge.
And tested again. I got this error:
Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net'
Inner exception:
{"Could not load file or assembly 'Common.Logging.Log4Net' or one of
its dependencies. The system cannot find the file
specified.":"Common.Logging.Log4Net"}
StackTrace:
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName,
ObjectHandleOnStack type) at
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) at
System.RuntimeType.GetType(String typeName, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError, Boolean
ignoreCase) at
Common.Logging.ConfigurationSectionHandler.ReadConfiguration(XmlNode
section) in
c:\CCNet\netcommon\trunk\modules\Common.Logging\src\Common\Common.Logging\Logging\ConfigurationSectionHandler.cs:line
130
3rd and last attempt
Finally I found assembly Common.Logging.Log4Net version 1.2.0.2 in spring examples so I used it.
Common.Logging.Log4Net version 1.2.0.2
Common.Logging version 1.2.0.0
log4Net 1.2.10.0
Tested and got again error:
{"Could not configure Common.Logging from configuration section
'common/logging'."}
Inner exception:
{"An error occurred creating the configuration section handler for
common/logging: Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net' (E:\C#
PROJECTS\STUDY\SPRING.NET\SpringNet.Aspects\LoggingWithLog4Net\bin\Debug\LoggingWithLog4Net.vshost.exe.Config
line 18)"}
StackTrace:
{"Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net'"}
I am really confuse what I do bad? Some problem with assemblies version?
For Spring.NET 1.3.2 you should use:
Common.Logging 2.0.0
Common.Logging.Log4Net 2.0.0
log4net 1.2.10
Make sure the last two log4net dll's are copied to the output directory. Since your code doesn't reference it directly, they might not be copied by Visual Studio.
Also, instead of
<resource uri="config://springs/objects"/>
Try
<resource uri="config://spring/objects"/>
In your config file the sectionGroup name is "spring", NOT "springs". I copied from yours to make mine work and got in the same problem. Finally figured out why.
Hope that helps!
Another possibility is:
Common.Logging 2.1.1
Common.Logging.Log4Net 2.1.1
log4net 1.2.10
I recommend skipping Common.Logging 2.1.0 as it did throw this exception when reading perfectly valid app.config section:
"Unable to cast object of type 'System.Configuration.DefaultSection' to type 'System.Configuration.AppSettingsSection'."
Installing 2.1.1 fixed the problem.

Azure Service Bus webHttpRelayBinding using WCF REST Template causes unnecessary aspNetCompatibilityEnabled error

I am using Azure Service Bus webHttpRelayBinding using WCF REST Template but it causes unnecessary aspNetCompatibilityEnabled error even though my service-class is correctly decorated:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
[ServiceContract( Namespace = "http://samples.microsoft.com/ServiceModel/Relay/")]
public class InsightDataService //: Insight.WebAPI.WCFRestImplementation.IInsightDataService
{...
My Web.Config:-
<system.serviceModel>
<services>
<service name="compname.WebAPI.WCFRestImplementation.InsightDataService" behaviorConfiguration="InsightDataServiceBehavior">
<endpoint address="https://namespacename.servicebus.windows.net/InsightDataService"
binding="webHttpRelayBinding"
contract="compname.WebAPI.WCFRestImplementation.InsightDataService"
behaviorConfiguration="sharedSecret"
name="default"
>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://namespacename.servicebus.windows.net/InsightDataService"/>
</baseAddresses>
</host>
</service>
</services>
<bindings>
<webHttpRelayBinding>
<binding name="webHttpRelayBinding"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647"
receiveTimeout="00:30:00"
sendTimeout="00:30:00"
openTimeout="00:30:00"
closeTimeout="00:30:00">
<security mode="None"></security>
</binding>
</webHttpRelayBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="InsightDataServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="True" />
<serviceThrottling
maxConcurrentCalls="20"
maxConcurrentInstances="2147483647"
maxConcurrentSessions="20"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="sharedSecret">
<transportClientEndpointBehavior credentialType="SharedSecret">
<clientCredentials>
<sharedSecret issuerName="owner"
issuerSecret="****************securitykey**********" />
</clientCredentials>
</transportClientEndpointBehavior>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint name="default" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
Exception is:-
[InvalidOperationException: The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as 'Allowed' or 'Required'.]
System.ServiceModel.Activation.HostedAspNetEnvironment.ValidateCompatibilityRequirements(AspNetCompatibilityRequirementsMode compatibilityMode) +119682
System.ServiceModel.Activation.AspNetCompatibilityRequirementsAttribute.System.ServiceModel.Description.IServiceBehavior.Validate(ServiceDescription description, ServiceHostBase serviceHostBase) +31
System.ServiceModel.Description.DispatcherBuilder.ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost) +190
System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +109
System.ServiceModel.ServiceHostBase.InitializeRuntime() +60
System.ServiceModel.ServiceHostBase.OnBeginOpen() +27
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +50
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +318
Microsoft.ServiceBus.RelayedSocketListener.Open(TimeSpan timeout) +56
Microsoft.ServiceBus.Channels.BufferedConnectionListener.Open(TimeSpan timeout) +55
Microsoft.ServiceBus.Channels.ConnectionAcceptor.Open(TimeSpan timeout) +55
Microsoft.ServiceBus.Channels.ConnectionDemuxer.StartDemuxing(TimeSpan timeout, OnViaDelegate viaDelegate) +74
Microsoft.ServiceBus.Channels.ConnectionDemuxer.Open(TimeSpan timeout) +46
Microsoft.ServiceBus.SocketConnectionTransportManager.OnOpen(TimeSpan timeout) +639
Microsoft.ServiceBus.Channels.TransportManager.Open(TimeSpan timeout, TransportChannelListener channelListener) +687
Microsoft.ServiceBus.Channels.TransportManagerContainer.Open(TimeSpan timeout, SelectTransportManagersCallback selectTransportManagerCallback) +286
Microsoft.ServiceBus.Channels.TransportChannelListener.OnOpen(TimeSpan timeout) +106
Microsoft.ServiceBus.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout) +92
Microsoft.ServiceBus.SocketConnectionChannelListener`2.OnOpen(TimeSpan timeout) +106
Microsoft.ServiceBus.Channels.CommunicationObject.Open(TimeSpan timeout) +658
Microsoft.ServiceBus.Channels.LayeredChannelListener`1.OnOpen(TimeSpan timeout) +89
Microsoft.ServiceBus.Channels.CommunicationObject.Open(TimeSpan timeout) +658
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72
[InvalidOperationException: The ChannelDispatcher at 'sb://namespacename.servicebus.windows.net/InsightDataService' with contract(s) '"InsightDataService"' is unable to open its IChannelListener.]
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +118
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +318
System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +111
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +318
System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +206
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651
[ServiceActivationException: The service '/InsightDataService' cannot be activated due to an exception during compilation. The exception message is: The ChannelDispatcher at 'sb://namespacename.servicebus.windows.net/InsightDataService' with contract(s) '"InsightDataService"' is unable to open its IChannelListener..]
System.Runtime.AsyncResult.End(IAsyncResult result) +688590
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
System.ServiceModel.Activation.AspNetRouteServiceHttpHandler.EndProcessRequest(IAsyncResult result) +6
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +96

Resources