Search Unity

2018.1 Create new c# file not added to visual studio project

Discussion in 'Editor & General Support' started by ktweedy1, May 3, 2018.

  1. ktweedy1

    ktweedy1

    Joined:
    Apr 16, 2010
    Posts:
    26
    When I right click in a folder in the project and say create c#. It creates a c# file with the default monobehavioursciprt.cs file name and has the c# script icon to the left. After I hit return to finalize the name the icon changes to a text file like icon with a little c# in the upper right corner. This new .cs file isn't getting adding to the visual studio project.

    Note, I had installed 2018.1 earlier today and it all seemed to be working fine. I started editing my scripts and working. Then one time after editing a script and hitting save in Visual Studio the script that I was working on someone wasn't recognized as a c# script any more even though it has a .cs file extension.

    Now any new .cs file I create all are getting ignored. I have restarted Unity. I have rebooted, but I can't get Unity to recognize this file as a c# file. Also have tried reimport the file.

    Anyone have any suggestions?

    EDIT: So I figured out why it was happening. The folder the file was in was name XR.Framework. If I rename it to XRFramework then the C# file works and gets compiled. So having the period in the folder name seems to be the issue.
     
    Last edited: May 3, 2018