• 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 Redtail87 · Feb 09, 2015 at 02:46 PM · errorfile

trying to parse FileNotFoundException causes compile error

Hello,

So I am trying to catch a FileNotFoundException and read the file from the exception like this:

 catch (FileNotFoundException e)
 {
     string file = e.FileName;
 }

Visual Studio throws no errors, but in unity at compile time it throws:

 Type `System.IO.FileNotFoundException' does not contain a definition for `FileName' and no extension method `FileName' of type `System.IO.FileNotFoundException' could be found (are you missing a using directive or an assembly reference?)

any idea why it would do this?

Comment
Add comment · Show 7
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 smoggach · Feb 09, 2015 at 03:05 PM 0
Share

Interesting. Have you done anything to your visual studio project? Only thing I can guess is that unity and visual studio aren't using the same .net framework.

avatar image Redtail87 · Feb 09, 2015 at 03:10 PM 0
Share

I don't think I have done anything to the VS project, I re-synced it just to make sure. VS is referenced to System.Core V3.5 and System V2. I am using a custom compiled version of the 4.6 UI, could that have something to do with it?

avatar image smoggach · Feb 09, 2015 at 03:24 PM 0
Share

Oh in that case then it makes sense your compiled version has a different idea of what .net is than your environment.

Did you compile it yourself? If not then that's a good place to start.

avatar image Redtail87 · Feb 09, 2015 at 03:29 PM 0
Share

yea, so I forked and cloned the ui repos. and just did some $$anonymous$$or changes, it is using the same version core and system.

avatar image smoggach · Feb 09, 2015 at 03:33 PM 0
Share

Something must be wrong with your solution. I'd bring this issue to whoever's repo you forked or the forums.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

20 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

Related Questions

i won't Use path relative to the project folder. 0 Answers

Permission re-activate error mac 2 Answers

Moving File Failed error [Solved] 2 Answers

HELP! Erorr! 3 Answers

Access is denied in Windows 8 App 0 Answers


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