Problem with script loading

HI Team,

I was moving along well but no unity will not recognise the script, the inspector says the associated script can not be loaded, please fix any compile errors.

the console shows in unity;
Assets\Mover.cs(19,2): error CS1513: } expected

when i try a brand new script and apply it to my object i get
“Cant add script component 'Mover” because the script class cannot be found.

when i load the script in vscode it says some projects had a problem loading and the output is a whole lot of Omnisharp errors

This is the bottom part of the omnisharp errors
warn: OmniSharp.MSBuild.ProjectManager

    Failed to load project file 'd:\projects\unity\obs course game\Assembly-CSharp.csproj'.

d:\projects\unity\obs course game\Assembly-CSharp.csproj

c:\Users\linca.vscode\extensions\ms-dotnettools.csharp-1.23.9.omnisharp\1.37.8-beta.4.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1216,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

    Attempted to update project that is not loaded: d:\projects\unity\obs course game\Assembly-CSharp.csproj
    No document found. File: d:\projects\unity\obs course game\Assets\Mover.cs.

Well i seem to have fixed my problem i reinstalled .net5 etc, rebooted and copied the repo code for the Mover.cs but it was still not working. I found the repo code file is missing a } in the void start() function.

I added that saved the file, went back and re-attached the file in unity and its working?

go figure as im not really sure what fixed this

Hi linchyde,

Did you manage to fix the problem?


See also:

Hi Nina,

Yes thankyou, i pretty much reinstalled everything and copied the code back in up to this point and got it working.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms