Visual Basic Development Bookmark and Share   
 Home > Visual Basic IDE > avoid open a project twice
 

avoid open a project twice

Hi all

it happened to me a lot - i double click a solution file and open it - change it and find out that its openned twice on my computer.
IN VB6 - you could not open the same vbp twice - how can I do that in vb.net 2005/2008

thanks
Guy
TIA Guy Cohen
Guy Cohen At Work  21 hours 4 minutes ago
Right click your project in the solution explorer. Select properties and under the "Application" vertical tab - look towards the bottom for a checkbox stating "Make Single Instance Application." Check this and you're good to go.
syntaxeater  20 hours 35 minutes ago
Hi

Thanks for trying
Iwas not referring to "run my application twice" which is probably solved by your text.
I was referring to the visual basic code - openned twice.

I dont want to open the solution twice by mistake by vb ide

thanks again
Guy
TIA Guy Cohen
Guy Cohen At Work  19 hours 17 minutes ago
I'm not aware of any IDE options for this, but that doesn't mean it's impossible.


Ranting an idea here -

1) write a quick stand-alone console app
2) disassociate .sln and .vbproj file extensions from the VS selector
3) associate your console app in its place
4) have your console app store off the project's guid or some identifier with an event handler indicating when the owned process closes to release
5) compare the identifier of what's currently being "opened" against your collection to determine if it should proceed
6) if it's a new instance - open it with "Microsoft Visual Studio Version Selector" as normal


Note - this doesn't protect against opening the project/solution multiple times from within the IDE but should mitigate some fat-fingering.
syntaxeater  18 hours 48 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• VB 2008 Handles Clause disappears
• Publish webservice at server
• Code Insertion
• Getprocesses on remote server with user/password
• VB Refactoring In Visual Studio 2005 Beta 1
• removal microsoft.visualbasic namespace
• Must remove a referenced DLL and Re-Add it every time the DLL Changes .. How do I Prevent this?
• how to make .NET framwork 2.0 WINDOWS App. run faster on VISTA? what cause it run so slower on VISTA machine?
• How to give Choice of Choosing Boolean Choices Or typing any number in Intellisense
• Update project references