aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Helios does not use configSource on connectionStrings in web.config

Open jchannon opened this issue 12 years ago • 11 comments

If you have something like

<connectionStrings configSource="connectionStringSource.config"></connectionStrings>

It fails using the Helios host

jchannon avatar Jul 09 '14 18:07 jchannon

Server Error in '/' Application.

Illegal characters in path.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Illegal characters in path.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Illegal characters in path.]

[ConfigurationErrorsException: The configSource attribute is invalid.: Illegal characters in path. (line 7)]

[TypeInitializationException: The type initializer for 'System.Net.ComNetOS' threw an exception.]

[TypeInitializationException: The type initializer for 'System.Net.ServicePointManager' threw an exception.] System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +303

[HttpException (0x80004005): The type initializer for 'System.Net.ServicePointManager' threw an exception.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9915300 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446

kevinchalet avatar Jul 09 '14 18:07 kevinchalet

Note that this works on Helios vNext but not on the "Katana version".

kevinchalet avatar Jul 09 '14 18:07 kevinchalet

Same problem!

lmaran avatar Jul 17 '14 16:07 lmaran

Thanks a lot for the info @PinpointTownes ! I will upgrade to vNext eventually but as for now I resolved this issue by inlining the file referred to by the configSource attribute.

anderssonjohan avatar Aug 28 '14 09:08 anderssonjohan

Inlining the file?

jchannon avatar Aug 28 '14 09:08 jchannon

Yep, I replaced the element with the content in the file referred to in the configSource attribute.

That workaround was good for me when prototyping, but it will not work in production. However, I will not put Helios v2.1 into production anyways.

anderssonjohan avatar Aug 29 '14 16:08 anderssonjohan

This issue is now resolved in the Katana-based version pending the next release.

GrabYourPitchforks avatar Jan 08 '15 21:01 GrabYourPitchforks

@GrabYourPitchforks out of curiosity, how did you fix this issue? :astonished:

kevinchalet avatar Jan 08 '15 21:01 kevinchalet

@PinpointTownes IIS's configuration system uses Windows long paths ("?\C:\directory\web.config"), but System.Configuration only supports normalized paths and UNC paths when looking at the 'configSource' attribute. I implemented a small fixup routine to convert back and forth between the two formats.

GrabYourPitchforks avatar Jan 08 '15 22:01 GrabYourPitchforks

@GrabYourPitchforks thanks for the details :innocent:

kevinchalet avatar Jan 08 '15 22:01 kevinchalet

111

DelTheCode avatar Aug 30 '17 07:08 DelTheCode