Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by user-319 · Nov 23, 2009 at 06:02 PM · editorvisualstudioexternal-tools

About the Visual C# Express Editor limitation

The unity environment doesn't allow you to use Visual C# Express 2008 as the external editor, saying it can't be handled from outside. I was wondering if this is a legal/license limitation or a technical one.

If it is a technical limitation, I found this workaround by using DDE: 1) download ClassExec from http://fvue.nl/wiki/ClassExec 2) Create a batch file (I used runvc.bat) in the same directory where you opened ClassExec, and put in the following contents :

classexec %1 --class .cs

3) Associate the batch file as your external editor in unity. 4) If Visual C# Express is open in the background and has the sync'ed solution open, when you double click a script in the unity editor the selected file will open in the existing Visual C# window, allowing you to edit it with code completion and all the fun features.

I'm considering adding this workaround to the unity wiki, but don't want to do anything evil. Is this legal?

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 Ferb · Jan 15, 2015 at 01:00 PM 0
Share

If anyone is still looking at this, there's now a Visual Studio Community Edition which means you can get all the Professional features for free, including full Unity integration.

6 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Lucas Meijer 1 · Nov 26, 2009 at 01:40 PM

We use COM to control visual studio pro to open the correct file at the correct line. Microsoft disabled COM suport for visual studio express. I've tried several different ways to make it do what we want anyway, but in the end, I couldn't get any of these more hacky methods working reliably on different machines with different language settings etc.

Please note that you can still use Visual Studio Express just fine to open the generated .sln file, and edit with autocompletion etc.

Comment
Add comment · Show 2 · 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 Laurent_Lavigne · Apr 24, 2010 at 06:19 PM 0
Share

You open to the correct line from within unity ? care to share your trick or script ?

avatar image Lucas Meijer 1 ♦♦ · Apr 25, 2010 at 10:01 PM 0
Share

I tried several things. $$anonymous$$ost stuff related to sending fake keyboard events in order to automate VisualStudioExpress. Check out something like AutoIt3. In the end it was just too damn hacky to be able to support.

avatar image
0

Answer by duck · Nov 23, 2009 at 06:19 PM

Can't comment on the legality of it (IANAL) although my guess would be that it isn't illegal.

However you might want to consider this trick - rename your copy of Uniscite.exe to some other name to preserve it as a backup (eg, "UnisciteBackup.exe"). Then place your batch file in the same folder, with the original name of the Uniscite exe. Make sure 'uniscite' is selected as the default editor, and you'll find that Unity passes the line number along as a parameter too! (it doesn't seem to do this if you select a different external editor).

Now, I haven't used "ClassExec" before, but if it supports it some method of doing so, you can then incorporate the line number into your script so it jumps to the correct line :)

Comment
Add comment · Show 1 · 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 user-319 · Nov 23, 2009 at 08:30 PM 0
Share

Hmm, interesting. The classexec method won't be able to do this because it just hooks on your windows settings and basically runs the program (and params etc) that are associated with the double clicking (or right clicking and selecting a certain action from the context menu) for a certain file type. It might be solvable by DDE launchers, although I haven't been able to get them to open the file in an existing instance of VCExpress, so I have up and took this method...

Still looking for some sort of authorization to share this, my guess is O$$anonymous$$ as well but prefer to be sure...

avatar image
0

Answer by Ricardo · Nov 25, 2009 at 11:08 PM

I don't see why it'd be illegal, or even against either of the licenses. What that Unity error means is probably that they didn't program Unity to command Visual Studio to open and move to a line.

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 davebuchhofer · Dec 09, 2009 at 09:42 PM

As a slightly tangential addition to the OP's classexec workaround, you can also route which IDE is loaded by the .bat file with a small addition, for instance, i send the .js and .shader filetypes to the UnityDevelop, but you can just as easily have them open in UniSciTE.exe (in your programfiles\unity\editor\data\tools\uniscite dir.. )

set classExecPath="C:\classexec\classexec.exe" set UnityDevelopPath="C:\Program Files\UnityDevelop\Unitydevelop.exe" GOTO :%~x1

:.cs ECHO "CS PATH" %classExecPath% %1 --class .cs GOTO :endscript

:.js ECHO "JS PATH" %UnityDevelopPath% %1 GOTO :endscript

:.shader ECHO "SHADER PATH" %UnityDevelopPath% %1 GOTO :endscript

:endscript

Comment
Add comment · Show 1 · 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 yoyo · Jan 11, 2012 at 08:20 PM 0
Share

Note that if you simply use 'start "" %1' then the file will open in whatever app you have associated with its file extension, which you can use to get the same effect.

avatar image
0

Answer by Davaris · Mar 12, 2010 at 06:18 AM

I followed the classexec %1 --class .cs instructions from the original poster and all it does is open the cs files in WordPad. :(

Comment
Add comment · Show 1 · 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 davebuchhofer · Mar 12, 2010 at 06:13 PM 0
Share

Associate the .cs files to default to visual studio.. I had a problem with getting this to work at home on Vista, but it works fine here on XP64, and appears to work in my superficial testing of windows7

  • 1
  • 2
  • ›

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

2 People are following this question.

avatar image avatar image

Related Questions

Script editors won't launch (at all) 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How to Edit Animator animationClips ? Editor 0 Answers

Unity Editor Extensions 1 Answer

How to check if a key is down in editor script 2 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