I am getting this error:
------ Test started: Assembly: ECEHire.Test.dll ------
Test 'ECEHire.Test.Tests.GenerateSchema_Fixture.Can_generate_schema' failed: NHibernate.HibernateException : Format of the initialization string does not conform to specification starting at index 49.
----> System.ArgumentException : Format of the initialization string does not conform to specification starting at index 49.
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action1 scriptAction, Boolean export, Boolean justDrop)
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script, Boolean export, Boolean justDrop)
GenerateSchema_Fixture.vb(18,0): at ECEHire.Test.Tests.GenerateSchema_Fixture.Can_generate_schema()
--ArgumentException
at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at NHibernate.Connection.DriverConnectionProvider.GetConnection()
at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action1 scriptAction, Boolean export, Boolean justDrop)
0 passed, 1 failed, 0 skipped, took 3.23 seconds (NUnit 2.5.10).
When I try to test my NHibernate configuration file.
The configuration file is:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.connection_string">Data Source=MyServerName;initial catalog=MyDatabaseName;Integrated Security=SSPI</property>
<property name="connection.isolation">ReadCommitted</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
</session-factory>
</hibernate-configuration>
The test that I am running is:
<Test()> _
Public Sub Can_generate_schema()
Dim cfg = New Configuration()
cfg.Configure()
cfg.AddAssembly(GetType(Question).Assembly)
Dim exp As NHibernate.Tool.hbm2ddl.SchemaExport = New NHibernate.Tool.hbm2ddl.SchemaExport(cfg)
exp.Execute(False, True, False)
End Sub
I believe that this is a connection string error, but the connection string works as part of the web.config file for querying the database via ADO.
A few things to try:-
Could it be something as simple as adding a ; (semi colon) e.g. Integrated Security=SSPI;
Or try changing to Integrated Security=True;
Or drop connection.connection_string and use connection.connection_string_name
In web.config
<connectionStrings>
<add name="db" connectionString="Data Source=MyServerName;initial catalog=MyDatabaseName;Integrated Security=SSPI;"/>
</connectionStrings>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
...
<property name="connection.connection_string_name">db</property>
...
</session-factory>
</hibernate-configuration>
Edit The next thing to try is to make sure that the configuration file is being used in your test so try this:-
cfg.Configure(#"c:\hibernate.cfg.xml");
Making sure that the path IS totally correct, If this fails then put a break point at this line:-
cfg.AddAssembly(GetType(Question).Assembly)
and then add this watch cfg.Properties and make sure that the connection string is present as a key value pair
Edit2
For unit testing you would need to copy local true and get path from executing assembly OR create an app.config and use:-
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property ../>
</session-factory>
</hibernate-configuration>
</configuration>
For a web site you could do:-
cfg.Configure(HttpContext.Current.Server.MapPath("~/hibernate.cfg.xml"));
To be honest there are lots of options and this is really another question!
Related
While configuring AWS SSO SAML 2.0 application by default it does not include and NameIdFormat and if we go with this default metadata for our Service Provider, Sustainsys/Saml2 giving error like below.
Which configuration we can use to make it working without any defined NameIdFormat ?
MetaData provided by Identity Provider
Please note <md:NameIDFormat /> in metadata
<?xml version="1.0" encoding="UTF-8"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://portal.sso.us-east-2.amazonaws.com/saml/assertion/REMOVED_FOR_BREVITY">
<md:IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>REMOVED_FOR_BREVITY</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</md:KeyDescriptor>
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://portal.sso.us-east-2.amazonaws.com/saml/logout/REMOVED_FOR_BREVITY" />
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://portal.sso.us-east-2.amazonaws.com/saml/logout/REMOVED_FOR_BREVITY" />
<md:NameIDFormat />
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://portal.sso.us-east-2.amazonaws.com/saml/assertion/REMOVED_FOR_BREVITY" />
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://portal.sso.us-east-2.amazonaws.com/saml/assertion/REMOVED_FOR_BREVITY" />
</md:IDPSSODescriptor>
</md:EntityDescriptor>
Error return by Sustainsys/Saml2
Sustainsys.Saml2.Metadata.MetadataSerializationException: NameIDFormat element with no uri
at Sustainsys.Saml2.Metadata.MetadataSerializer.ReadNameIDFormat(XmlReader reader)
at Sustainsys.Saml2.Metadata.MetadataSerializer.ReadSsoDescriptorElement(XmlReader reader, SsoDescriptor descriptor)
at Sustainsys.Saml2.Metadata.MetadataSerializer.<>c__DisplayClass119_0.<ReadIdpSsoDescriptor>b__0()
at Sustainsys.Saml2.Metadata.MetadataSerializer.ReadChildren(XmlReader reader, Func`1 childAction)
at Sustainsys.Saml2.Metadata.MetadataSerializer.ReadIdpSsoDescriptor(XmlReader reader)
at Sustainsys.Saml2.Metadata.MetadataSerializer.<>c__DisplayClass118_0.<ReadEntityDescriptor>b__0()
at Sustainsys.Saml2.Metadata.MetadataSerializer.ReadChildren(XmlReader reader, Func`1 childAction)
at Sustainsys.Saml2.Metadata.MetadataSerializer.ReadEntityDescriptor(XmlReader reader, SecurityTokenResolver tokenResolver)
at Sustainsys.Saml2.Metadata.MetadataLoader.Load(XmlDictionaryReader reader)
at Sustainsys.Saml2.Metadata.MetadataLoader.Load(String metadataLocation, IEnumerable`1 signingKeys, Boolean validateCertificate, String minIncomingSigningAlgorithm)
at Sustainsys.Saml2.Metadata.MetadataLoader.LoadIdp(String metadataLocation, Boolean unpackEntitiesDescriptor)
at Sustainsys.Saml2.IdentityProvider.DoLoadMetadata()
at Sustainsys.Saml2.IdentityProvider.set_LoadMetadata(Boolean value)......
I have created ASP.NET Core project from command line:
> dotnet new web
> dotnet restore
> dotnet build
> dotnet run
All works fine.
Now I have opened this project in Visual Studio 2017.
Debug - Start without debugging:
Unhandled Exception: System.IO.FileNotFoundException: Could not load
file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified. at
System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken,
IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs,
Int32 methodInstCount, ObjectHandleOnStack type) at
System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module,
Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext,
RuntimeTypeHandle[] methodInstantiationContext) at
System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken,
Type[] genericTypeArguments, Type[] genericMethodArguments) at
System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord
caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly,
RuntimeModule decoratedModule, MetadataToken decoratedToken,
RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[]
attributes, IList derivedAttributes, RuntimeType& attributeType,
IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean&
isVarArg) at
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule
decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount,
RuntimeType attributeFilterType, Boolean mustBeInheritable, IList
derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) at
System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly
assembly, RuntimeType caType) at
System.Attribute.GetCustomAttributes(Assembly element, Type
attributeType, Boolean inherit) at
System.AppDomain.GetTargetFrameworkName()
How can I launcn, debug and develop my project in VS ?
p.s. I know I can create new project in VS and it works fine, but I need to work with project which was created from command line.
Update:
PS Q:\tsts> dotnet --version
1.0.0
PS Q:\tsts> type .\tsts.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
</ItemGroup>
</Project>
PS Q:\tsts> dotnet build
Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.
tsts -> Q:\tsts\bin\Debug\netcoreapp1.1\tsts.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:02.90
Opening and running dotnet new project in VS2017 should work.
But sometimes VS goes crazy with strange and inexplicable "not found" dependencies and "not compiled" new files - then just close VS (or unload project), manually remove bin and obj folders and reopen project.
Hi I am still fairly new to Spring in general. I have been using WebServiceExporter to expose my WebServices. However, when I tried to add another WebService to my Web.xml I get the following error:
[ArgumentException: Duplicate type name within an assembly.]
System.Reflection.Emit.ModuleBuilder.CheckTypeNameConflict(String strTypeName, Type enclosingType) +14200621
System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType) +91
System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, ModuleBuilder module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType) +161
System.Reflection.Emit.ModuleBuilder.DefineTypeNoLock(String name, TypeAttributes attr, Type parent, Type[] interfaces, PackingSize packingSize, Int32 typesize) +103
System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent) +289
Spring.Proxy.DynamicProxyManager.CreateTypeBuilder(String typeName, Type baseType) +145
[ArgumentException: Proxy already registered for "UserWebService" as Type "UserWebService".]
Spring.Proxy.DynamicProxyManager.CreateTypeBuilder(String typeName, Type baseType) +353
Spring.Proxy.CompositionProxyTypeBuilder.BuildProxyType() +149
Spring.Web.Services.WebServiceExporter.GenerateProxy() +333
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InvokeInitMethods(Object target, String name, IConfigurableObjectDefinition definition) +269
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) +660
Spring.Objects.Factory.Support.WebObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) +135
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) +933
[ObjectCreationException: Error creating object with name 'UserWebService' defined in 'file [C:\CODE\Kupla\Kupla\Web.xml] line 13' : Initialization of object failed : Proxy already registered for "UserWebService" as Type "UserWebService".]
Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) +1419
Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) +389
Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure) +2103
Spring.Objects.Factory.Support.DefaultListableObjectFactory.PreInstantiateSingletons() +875
Spring.Context.Support.AbstractApplicationContext.Refresh() +1225
Spring.Context.Support.WebApplicationContext..ctor(WebApplicationContextArgs args) +179
_dynamic_Spring.Context.Support.WebApplicationContext..ctor(Object[] ) +252
Spring.Context.Support.RootContextInstantiator.InvokeContextConstructor(ConstructorInfo ctor) +168
Spring.Context.Support.ContextHandler.InstantiateContext(IApplicationContext parentContext, Object configContext, String contextName, Type contextType, Boolean caseSensitive, String[] resources) +192
Spring.Context.Support.WebContextHandler.InstantiateContext(IApplicationContext parent, Object configContext, String contextName, Type contextType, Boolean caseSensitive, String[] resources) +413
Spring.Context.Support.ContextHandler.Create(Object parent, Object configContext, XmlNode section) +520
[ConfigurationErrorsException: Error creating context 'spring.root': Duplicate type name within an assembly.]
System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult) +347
System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject) +2277
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +1849
System.Configuration.BaseConfigurationRecord.GetSection(String configKey) +69
Spring.Util.ConfigurationUtils.GetSection(String sectionName) +270
Spring.Context.Support.WebApplicationContext.GetContextInternal(String virtualPath) +1663
Spring.Context.Support.WebSupportModule.Init(HttpApplication app) +665
System.Web.HttpApplication.InitModulesCommon() +192
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1678
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +390
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +194
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +293
Has anyone else experienced this with Spring before, I am really struggling to see what is wrong. My web.xml contains:
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<object type="default.aspx">
<property name="SessionObjectHolder" ref="SessionObjectHolder"/>
</object>
<object type="home.aspx">
<property name="UserBLL" ref="UserBLL"/>
<property name="SessionObjectHolder" ref="SessionObjectHolder"/>
</object>
<object id="UserWebService" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="UserWebServiceDTO"/>
<property name="Namespace" value="http://test.co.uk"/>
<property name="Description" value="This is User Web Service"/>
<property name="TypeAttributes">
<list>
<object type="System.Web.Script.Services.ScriptServiceAttribute, System.Web.Extensions"/>
</list>
</property>
</object>
<object id="UserWebServiceDTO" type="Kupla.ServiceLayer.UserWebService, Kupla.ServiceLayer">
<property name="UserBLL" ref="UserBLL" />
</object>
<object id="SessionObjectHolderWebService" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="SessionObjectHolderWebServiceDTO"/>
<property name="Namespace" value="http://test.co.uk"/>
<property name="Description" value="This is the session object holder web service"/>
<property name="TypeAttributes">
<list>
<object type="System.Web.Script.Services.ScriptServiceAttribute, System.Web.Extensions"/>
</list>
</property>
</object>
<object id="SessionObjectHolderWebServiceDTO" type="Kupla.ServiceLayer.SessionObjectHolderWebService, Kupla.ServiceLayer">
<property name="UserBLL" ref="UserBLL" />
</object>
</objects>
Many many thanks in advance.
Do your asmx or svc files exist? They should be removed when creating services by Spring, because one instance is created by Spring and second by IIS/.NET.
Edit
I haven't found this earlier, but WebServiceExporter registers type of object's name - UserWebService and SessionObjectHolderWebService in your case. But these types already exists (created by yourself), you call those objects with DTO suffix. Try to add suffix Exporter to objects created by WebServiceExporter.
The reason why you get different error while swapping services in config file is because Spring only returns the very first error. It can be quite painful in large projects.
I have a C++/CLI DLL that needs to run in the context of an ASP.NET WebApi action.
The action is affected by an ActionFilter that uses log4net's LogicalThreadContext to set a property containing a request ID; this works nicely to write the request ID into the log entries.
The problem is that ASP.NET seems to be creating an appdomain when it's time to load the class from the C++/CLI dll. (I can't seem to find any documentation on how that works; I'd love to find some.) When the appdomain plumbing tries to deserialize everything, it chokes because it can't find log4net.dll (see stack trace below).
Fusion logs show that it's looking in C:\Windows\System32\inetsrv, which is incorrect... I would expect it to look in the probing path or along the %PATH% environment variable.
A few data points:
log4net.dll is available in the web app's bin directory and works fine for everything else I'm using it for.
The C++/CLI code has no dependencies on log4net.
If I comment out my calls to log4net.LogicalThreadContext.Properties[...], everything works fine.
If I copy log4net.dll from my bin folder to C:\Windows\system32\inetsrv, everything works fine.
The web.config file specifies the probing path with a <probing privatePath="bin"/> element.
My Application_Start method in global.asax.cs prepends the web app's bin directory to the %PATH% environment variable:
var currentPathEnvVar = Environment.GetEnvironmentVariable("PATH");
var binPath = Path.Combine(Server.MapPath("~") ?? String.Empty, "bin");
_log.DebugFormat("Prepending paths to PATH: [{0}]", binPath);
Environment.SetEnvironmentVariable("PATH", String.Concat(binPath, Path.PathSeparator, currentPathEnvVar));
The log shows that the %PATH% is getting prepended correctly:
2015-06-05 17:07:48,816 1 DEBUG MyNamespace.WebApiApplication (null) Prepending paths to PATH: [C:\Program Files\MyCompany\MyApp\web\bin]
So how do I get the appdomain that ASP.NET creates to look in the right place to load assemblies?
Thanks.
Here's the stack trace that gets logged when all this goes down.
2015-06-05 17:08:41,148 23 ERROR MyNamespace.MyController (null) Controller action failed
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
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 System.AppDomain.IsDefaultAppDomain()
at <CrtImplementationDetails>.GetDefaultDomain() in f:\dd\vctools\crt\crtw32\h\minternal.h:line 367
at <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 401
at <CrtImplementationDetails>.DefaultDomain.Initialize() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 278
at <CrtImplementationDetails>.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 343
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 546
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 703
--- End of inner exception stack trace ---
at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 194
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 713
at .cctor() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 754
--- End of inner exception stack trace ---
at MyNamespace.MyController.MyAction(String foo, Int64 bar, String baz)
This helped me to resolve similar issue:
https://blogs.msdn.microsoft.com/jorman/2007/08/31/loading-c-assemblies-in-asp-net/
Faced option 2.a and proposed solution worked fine:
protected void Application_Start(object sender, EventArgs e){
String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH"), ";",
System.AppDomain.CurrentDomain.RelativeSearchPath);
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process); }
I had moved my asp.net2 web-forms website to IIS8 base on windows server 2012 and i found in my event log many of the next warning :
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="ASP.NET 2.0.50727.0" />
<EventID Qualifiers="32768">1309</EventID>
<Level>3</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2014-01-02T20:44:47.000000000Z" />
<EventRecordID>2716</EventRecordID>
<Channel>Application</Channel>
<Computer>WIN-6GSFHL7R9M0</Computer>
<Security />
</System>
- <EventData>
<Data>3005</Data>
<Data>An unhandled exception has occurred.</Data>
<Data>02/01/2014 22:44:47</Data>
<Data>02/01/2014 20:44:47</Data>
<Data>8ba10465853a48c2a3a0ffc833750679</Data>
<Data>7</Data>
<Data>1</Data>
<Data>0</Data>
<Data>/LM/W3SVC/12/ROOT-2-130331688695275608</Data>
<Data>Full</Data>
<Data>/</Data>
<Data>C:\Inetpub\vhosts\domain.com\httpdocs\</Data>
<Data>WIN-6GSFHL7R9M0</Data>
<Data />
<Data>5216</Data>
<Data>w3wp.exe</Data>
<Data>WIN-6GSFHL7R9M0\IWPD_6(domain)</Data>
<Data>HttpException</Data>
<Data>Unable to validate data.</Data>
<Data>http://www.domain.com/ScriptResource.axd?d=neQR-vF3_EGwaDvBqhWT03ESuzxtn9v9XFCS44TLY3AvlJgJaiF16o8T3xF9JpxAa4aVdi8FBtTu_aoQwDJm1er-TLBDOoBFHQOWr7lHPFlEhPXZ5Y_wPNlfd8wmC4SLUpFTqQ2&t=635240882914102167</Data>
<Data>/ScriptResource.axd</Data>
<Data>157.55.35.41</Data>
<Data />
<Data>False</Data>
<Data />
<Data>WIN-6GSFHL7R9M0\IWPD_6(domain)</Data>
<Data>5</Data>
<Data>WIN-6GSFHL7R9M0\IWPD_6(domain)</Data>
<Data>False</Data>
<Data>at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo, Boolean signData) at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.UI.Page.DecryptString(String s)</Data>
</EventData>
</Event>
I have tried the following things :
Use of specifying machine key
Add renderAllHiddenFieldsAtTopOfForm="true"
I saw many posts suggesting EnableViewStateMAC=false, but it's sound stupid and dangers
Is this exception dangers? what i'm missing ?
I wouldn't worry about it.
The most likely explanation is that a search crawler / indexer has cached the old URLs and is checking them again to make sure they're still valid. Since ScriptResource.axd returns 404 for these now-incorrect URLs, the search crawler will eventually flush them from its cache, and over time you'll see these errors disappear.