- Home /
Visual studio for compile
Hello, i had some trouble with boo and mono so i took an advice in the forum to install visual studio.
Now when i compile my file with vs its working perfectly however when i click on the start play button on unity it throws again mono bug related errors.
test.boo
import sys
sys.path.append(UnityEngine.Application.dataPath)
import pytest
pytest.tester()
gives
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0
and
Assets/test.boo(3,1): BCE0044: expecting "EOF", found 'import'.
Now i heard too much bad about your mono version i would rather replace it altogether than debugging it.
Answer by BMayne · Sep 02, 2015 at 03:53 PM
Hey there,
Are you making a dll or just editing the code for Unity?
If you are not making a dll (a standalone library) you do not build the project ever. Unity does this for you behind the scenes and takes some special steps to do this.
Cheers,
Well, you can compile it in Visual Studio to check for syntax errors, but that isn't the build that counts.
@Dave Carlile But VS already does that on the go while you're typing. So still wouldn't really make any sense if he is not doing anything with a dll.
Well i guess i will not work too much with c# or java anyways since i got python running now so it not important...
Answer by D3Duck · Sep 01, 2015 at 09:02 PM
Hey,
You need to use this.
Also make very sure you have the correct version of VS (Visual Studio Community 2013, the free one) because I had the wrong one too and it was not working.
When you've installed it, just need to import the little asset that comes with it and click "Generate Project Files" for it to work with that specific project, but you will never have other problems and debugging works perfectly
(Unsupported opinion: VS is endlessly better than Mono)
EDIT:
I just read on the site that they advertise it with VS2015. It wasn't available when I got it some time back but if it works with 2015 you should just go for that I guess.
Hello, i have this already and integrated with unity but unity still compiles with mono. so i would debug with vs and compile for unity with mono.
Answer by FortisVenaliter · Sep 01, 2015 at 09:13 PM
Another alternative... I hate the mono editor too, so I use Visual Studio to edit my code, but I don't compile it there, I let Unity do so. You can't click directly to the errors that way, but it just works with no extra setup steps.
Your answer
Follow this Question
Related Questions
How do I get set up with a programming language and everything. 2 Answers
Using Team Foundation Server with Unity3D and MonoDevelop 3 Answers
Can I get documentation snippets in addition to intellisense? 2 Answers
Revert script editor to Mono instead of VS? 2 Answers
Keeping Unity 2.6 and MonoDevelop 2.4 running at same time 1 Answer