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 FeetSlashBirds · Apr 25, 2014 at 06:30 AM · editornetworkingbuildirc

Differences between running in Unity Editor vs. standalone .exe?

I'm guessing this is just some configuration oddity I'm overlooking when I build but here's the strange behavior I'm seeing:

I have a game that supports in-game chat via IRC. To connect to IRC the game is using the SmartIrc4net library here: https://github.com/meebey/SmartIrc4net

Everything is coded and works fine when I run the game from within the Unity Editor. However, when I build and run the game as a standalone .exe none of the outgoing connections to IRC appear to happen. The game client never makes a call to the IRC server.

Is there some sort of network policy or sandboxing or something... that is different in the Unity Editor vs. an exe?

Thanks

EDIT: In the output_log I see the follow (note, I dont see these errors when running in the Unity editor)

This has something to do with the initialization of the IrcClient class in SmartIrc4net. Again... I dont understand why it works in the Editor and not in the exe.

 ArgumentOutOfRangeException: Argument is out of range.
 
 Parameter name: options
   at System.Text.RegularExpressions.Regex.validate_options (RegexOptions options) [0x00000] in <filename unknown>:0 
 
   at System.Text.RegularExpressions.Regex..ctor (System.String pattern, RegexOptions options) [0x00000] in <filename unknown>:0 
 
   at Meebey.SmartIrc4net.IrcClient..cctor () [0x00000] in <filename unknown>:0 
 Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Meebey.SmartIrc4net.IrcClient
   at IrcManager..cctor () [0x00000] in <filename unknown>:0 
 Rethrow as TypeInitializationException: An exception was thrown by the type initializer for IrcManager
 
  
 (Filename:  Line: -1)
Comment
Add comment · Show 1
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
avatar image liortal · Apr 25, 2014 at 09:54 AM 0
Share

What version of Irc4net are you using? can you send a link/share IrcClient.cs somehow (e.g: Pastebin)

1 Reply

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by FeetSlashBirds · Apr 25, 2014 at 11:52 AM

I figured it out... to fixed it I had to open the Build Menu -> Player Settings -> Other Settings and change API Compatibility Level to .net 2.0 (instead of .net 2.0 subset).

Thanks to these two threads for leading the way to the solution:

http://answers.unity3d.com/questions/350372/whats-the-deal-with-the-cctor-error.html

"the problem occurs when you define AND initialize a variable that uses a reference that doesn't exist yet - or hasn't been initialized yet"

http://www.codeproject.com/Questions/67419/The-type-initializer-for-threw-an-exception

"change your .net framework to lower"

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

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

OnServerStart not being called in standalone build. Works in editor. 1 Answer

OnServerStart not working in Build. Works in editor 1 Answer

Distribute terrain in zones 3 Answers

Unity acting really weird when playing builds 1 Answer

Build Standalone (.exe) with google cardboard VR. 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