Exe.config causing a problem

Hi,

It seems when I get a NuGet Package and try to use it I run into issues. In this case I am using Newton Json to deserialize some json code I get from using elements Http request. In this method when Http.TryGetJson(request) is executed I get the message “Configuration system failed to initalize”.

func GetLastFMDataJson() -> JsonDocument? {

    let metaDataUrl = "http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=Shinedown&track=monsters&api_key=12d09558d044c0298211cece08f840a0&format=json"

    let request = HttpRequest(Url.UrlWithString(metaDataUrl) )
    request.Mode = HttpRequestMode.Post
    request.FollowRedirects = true

    let j = Http.TryGetJson(request)

    return j
}

This code worked fine before I added the NewtonJson Nuget. If I delete the exe.config file this code works but ofc the NewtonJson code fails.

This is the exe.config file

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
</packages>

I have attached a test project which should show the problem

httpRequestTest.zip (4.7 MB)

Thanks!

That doesn’t look like a valid .exe.config structure… you want something like

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<configSections>
		<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
			<section name="YOURNAMESPACE.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
		</sectionGroup>
	</configSections>
	<userSettings>
		<YOURNAMESPACE.Properties.Settings>
			<setting name="SOMESETTING" serializeAs="String">
				<value>SOMEVALUE</value>
			</setting>
		</YOURNAMESPACE.Properties.Settings>
	</userSettings>
</configuration>

Thanks Marc,

the exe.config file is auto generated when it compiles. Is that a VS issue than?

Looks like an EBuild bug if there is any file called *.config. Fixed for vNext.

ps, why are you still using VS? :frowning:

.2321 is up now and should fix this.