Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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
1
Question by Fillmore · Mar 09, 2018 at 10:13 PM · stringdllsplitmissingmethodexception

Custom DLL - MissingMethodException: string[] string.Split

For some reason, I can't get string.split to work from within the dll. (I can successfully use it in Unity/C#)

Here is a snip of my C# code in a separate solution:

     using System;
     using System.Collections.Generic;
     
     namespace DLLPackage
     {
         public class TimeSheet : BaseObject
         {
             public TimeSheet(string builder)
             {
                 string[] elements = builder.Split(',');
             }
         }
 }


Everything compiles great. I put the dll in my assets/plugins folder.

 namespace UnityApp
 {
     public static class Portfolio
     {
         public static void Example()
         {
             TimeSheet t = new TimeSheet("-1,0,0,0");
 //MissingMethodException: string[] string.Split(char,System.StringSplitOptions)
 
 }
 }
 }



I have tried various cleans/rebuilds/renames that I found while googling. Nothing seems to help, it's ONLY this system method. I can call other system methods, my own methods, my own constructors no problem.

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 Fillmore · Mar 09, 2018 at 10:26 PM 0
Share

Also happens in a method, not just the constructor

3 Replies

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

Answer by Fillmore · Mar 09, 2018 at 10:44 PM

Alright, after I wasted half a day on this, if anyone finds this - Your solution template is wrong. Also see below @AllanSmithZ3 and @Otto_Oliveira answers. Depending on your use case, try the various settings until you get something that will work for your project.


(On OSX) When I made a new solution I selected "Class Library .NET Core". I made a "Portable Library Multiplatform" with my same files, and it fixed it.


The only thing that tipped me off was on this page: https://msdn.microsoft.com/en-us/library/tabh47cf(v=vs.110).aspx It says: Portable Class Library Supported in: portable .NET platforms


Not 100% sure if this solution type is what I should continue with, but it seems to be working for now.

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
avatar image
0

Answer by Otto_Oliveira · Mar 31, 2019 at 09:56 PM

Hi @Fillmore , In my case, I fixed this creating a Empty C# Project and then adding the necessary References, as you can see the 'System' assembly.

alt text Using this method it's also necessary to change the Compile Target to Library. Currently I'm using Unity 2018.3 so I kept the Target Framework to 4.7.1 alt text


option.png (75.2 kB)
proj.png (164.3 kB)
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
avatar image
0

Answer by AllanSmithZ3 · Jun 07, 2019 at 05:10 PM

Hey @Fillmore, answering about one year later but... since PLC is deprecated now its a better idea to create .NET Standard 2.0 class library instead of PLC, and it solves this problem as well. I know because I literally just did this, first I was following your answer, then noticed that System.Serializable doesnt work for PLC, but it does for .NET Standard 2.0, so I changed my projects back to .NET Standard 2.0 and finally string.split is working.

At any rate, thanks for the original answer haha, had you not posted it I probably would have taken years to figure it out that you need a different project type...

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

77 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 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 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 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

Splitting String Into Array 2 Answers

converted array item to string returns "s,tri,ng" with commas? 1 Answer

Change part of a string [Solved] 3 Answers

Strings, Arrays and Split in js 1 Answer

Get text between two tags C# 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