Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Esther Rock · Mar 25, 2011 at 05:30 AM · erroriphoneexceptionwebconfiguration

Exception: INTERNAL configuration error: failed to get configuration 'system.diagnostics'

I am currently working on getting the Amazon Web Service, SimpleDB to work on iOS.

I am using a third part C# lib for AWS SimpleDB called Simple Savant. http://simol.codeplex.com/

Simple Savant works great in the editor, but I have had a few issues with getting it to run on iOS. I have been able to use the latest release's source code to build for myself as I needed to be able to get around a JIT compile issue regard .GetValue(), which I replaced with .GetGetMethod().Invoke(), that seemed to work well. Unfortunately I have hit a bit of a roadblock, as I am unable to get past my latest exception.

Exception: INTERNAL configuration error: failed to get configuration 'system.diagnostics' at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x00000] in <filename unknown>:0 at System.Diagnostics.TraceImpl.InitOnce () [0x00000] in <filename unknown>:0 at System.Diagnostics.TraceImpl.get_Listeners () [0x00000] in <filename unknown>:0 at System.Diagnostics.TraceImpl.get_ListenersSyncRoot () [0x00000] in <filename unknown>:0 at System.Diagnostics.TraceImpl.Write (System.String message) [0x00000] in <filename unknown>:0 at System.Diagnostics.Trace.Write (System.String message) [0x00000] in <filename unknown>:0 at Amazon.SimpleDB.AmazonSimpleDBClient.Invoke[CreateDomainResponse] (IDictionary`2 parameters) [0x00000] in <filename unknown>:0 at Amazon.SimpleDB.AmazonSimpleDBClient.CreateDomain (Amazon.SimpleDB.Model.CreateDomainRequest request) [0x00000] in <filename unknown>:0 at Coditate.Savant.Core.DecoratingSimpleDB.CreateDomain (Amazon.SimpleDB.Model.CreateDomainRequest request) [0x00000] in <filename unknown>:0 at Coditate.Savant.Core.DomainCreatingSavant.EnsureDomain (System.String domainName) [0x00000] in <filename unknown>:0 at Coditate.Savant.Core.DomainCreatingSavant.PutAttributes (Coditate.Savant.ItemMapping mapping, Coditate.Savant.PropertyValues[] values) [0x00000] in <filename unknown>:0 at Coditate.Savant.Core.DecoratingSavant.PutAttributes (Coditate.Savant.ItemMapping mapping, Coditate.Savant.PropertyValues[] values) [0x00000] in <filename unknown>:0 at Coditate.Savant.Core.ConstrainingSavant.PutAttributes (Coditate.Savant.ItemMapping mapping, Coditate.Savant.PropertyValues[] values) [0x00000] in <filename unknown>:0 at Coditate.Savant.SimpleSavant.Put (System.Object[] items) [0x00000] in <filename unknown>:0 at DatabaseCore.WriteToDB () [0x00000] in <filename unknown>:0 at LoginScreen.OnLogin () [0x00000] in <filename unknown>:0

(Filename: Line: -1)

I am using Unity 3.3, with an iPad 2 on OS X Snow Leopard.

My Api Compatibility Level is set to ".NET 2.0"

My stripping level is set to "Disabled"

I am able to build out to the device, but when I trigger my DatabaseCore.WriteToDB method, I get an exception, and I am unsure how to proceed. If anyone has any thoughts, please let me know!

  • E

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Incarnadine · Feb 08, 2013 at 06:32 PM

Besides not providing a good way to get an app.config file where it belongs in the deployment, Unity has also done something funky with the config system where it's not even recognizing the default configuration handlers registered in machine.config. I was able to work around this as follows.

Add System.Configuration.dll to your Assets folder. This is already included in a normal player build from what I can tell, but for some reason doesn't get added as a project reference.

Add an app.config to Assets/StreamingAssets

 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <configSections>
         <section name="system.diagnostics" type="System.Diagnostics.DiagnosticsConfigurationHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     </configSections>
     <system.diagnostics>
         <trace autoflush="true" />
     </system.diagnostics>
 </configuration>

Register it on startup with some reflection hackery.

     void InitializeAppConfig()
     {
         var configFile = Application.streamingAssetsPath + "/app.config";
         
         Debug.Log("App Config Path: " + configFile);
                 
         var configFileMap = new ExeConfigurationFileMap() {
             ExeConfigFilename = configFile
         };
                 
         var config = ConfigurationManager.OpenMappedExeConfiguration(
             configFileMap, ConfigurationUserLevel.None);
                 
         var configSystemField = typeof(ConfigurationManager).GetField("configSystem", 
             System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
                 
         var configSystem = configSystemField.GetValue(null);
         
         Debug.Log("ConfigSystem type = " + configSystem.GetType().ToString());
         
         var cfgField = configSystem.GetType().GetField("cfg", 
             System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
         
         cfgField.SetValue(configSystem, config);        
     }

This should work with all players with access to the file system. The web player won't work with this approach and probably not the Android one either since the app is in a JAR. With more time staring at the code to Mono it might be possible to hack a Configuration instance that doesn't rely solely on the file system to read the config for more platforms.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

can't run game through xcode; works when launched from iphone 1 Answer

Unity IL2CPP 0 Answers

get_fullResolution() index outside the bounds of the array exception 0 Answers

Getting "TlsException: Handshake failed" when I execute transaction method to get answer from a cloud DB 0 Answers

Stupid "Reference Exception Error" 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges