Workaround for slow solution loading in VS2012 #113

Closed
Alphapage opened this Issue Jan 17, 2013 · 8 comments

Comments

Projects
None yet
2 participants
@Alphapage
Contributor

Alphapage commented Jan 17, 2013

Hello,
If you want to quickly open the solution in VS2012 for the first time or when you rename the solution folder, here is how I do:

  • in Run dialog box, open : "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /safemode
  • open the solution (VS2012 will load Console or wpf projects only because of safemode)
  • close VS2012
  • open the solution in "normal mode"
  • reload projects in each folders except Samples folder
    You are done within less than 5 minutes.

If you want to open projects in Samples folder, disable VS2012Monotouch addin, restart VS2012 and proceed.
Then enable VS2012Monotouch addin, restart VS2012 and load the Touch UI project only when needed.
Why?
Touch library load quickly (no problem), but Touch UI project uses IphoneSimulator or Iphone configuration instead of AnyCpu.
I don't know why those projects are so slow to load, but if you change config to AnyCpu the project loads quickly (bug 1).
But another problem is if you don't unload all Touch UI projects, any project (even non Touch UI project) will reload very slowly (bug 2).
I mean if all UI Touch projects are unloaded, you can unload/reload other projects quicly except UI Touch project of course. But as soon as you load 1 UI Touch project, loading/unloading another project except UI Touch project becomes very slow.

Finally, I suspect VS2012 to reload all (or some) projects each time you reload 1 project resulting in cascading reloads and unnecessary loops (bug 3).
When you open the project for the first time, another feeling is that VS2012 is also waiting for some dialog box results in the background delaying the process depending on a timeout foreach dialog, but this is my opinion.

Hope this helps.

@Alphapage

This comment has been minimized.

Show comment
Hide comment
@Alphapage

Alphapage Jan 17, 2013

Contributor

I tried to add Condition="'$(OS)' != 'Windows_NT' And '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' " to PropertyGroup in UI Touch project, which works like a charm in VS2012, but Monodevelop complains on OSX.
xbuild doesn't support Choose When elements in csproj (rrrrrrrrrrrrrrrrr!!!!!!!!!!) which would solve the problem.
No success.

Contributor

Alphapage commented Jan 17, 2013

I tried to add Condition="'$(OS)' != 'Windows_NT' And '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' " to PropertyGroup in UI Touch project, which works like a charm in VS2012, but Monodevelop complains on OSX.
xbuild doesn't support Choose When elements in csproj (rrrrrrrrrrrrrrrrr!!!!!!!!!!) which would solve the problem.
No success.

@slodge

This comment has been minimized.

Show comment
Hide comment
@slodge

slodge Jan 17, 2013

Contributor

Thanks - this isn't an issue... so I'll close it

Will repost your advice on my blog - or happy to link to your page/blog if you have one....

Stuart

Contributor

slodge commented Jan 17, 2013

Thanks - this isn't an issue... so I'll close it

Will repost your advice on my blog - or happy to link to your page/blog if you have one....

Stuart

@slodge slodge closed this Jan 17, 2013

@slodge

This comment has been minimized.

Show comment
Hide comment
@slodge

slodge Jan 17, 2013

Contributor

Blogged - http://slodge.blogspot.co.uk/2013/01/avoiding-vsmonotouchvs2012-slowness.html

Also especially to say thanks for this (it is a big problem) then I'm very happy to award it a badge of awesomeness - thanks!

Contributor

slodge commented Jan 17, 2013

Blogged - http://slodge.blogspot.co.uk/2013/01/avoiding-vsmonotouchvs2012-slowness.html

Also especially to say thanks for this (it is a big problem) then I'm very happy to award it a badge of awesomeness - thanks!

@Alphapage

This comment has been minimized.

Show comment
Hide comment
@Alphapage

Alphapage Jan 17, 2013

Contributor

I found a way to bypass the slow loading of Touch UI projects.
Follow previous steps to get all projects loaded except Touch UI projects.
From there, edit each Touch UI project and add the following lines before Debug|iPhoneSimulator PropertyGroup:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>True</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>False</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoStdLib>True</NoStdLib>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>True</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoStdLib>True</NoStdLib>
  </PropertyGroup>

Close and reopen VS2012. All projects should be loaded else reload the unavailable projects.
Right-Click on Solution -> Properties -> Select : Configuration properties
For each UI Touch projects, replace by AnyCPU and select build if not.
You are done: unload and reload any project within seconds.

I don't know if this could cause other problems or if new limitations occurred, but it seems to work on both VS2012 and Monodevelop OSX.
VS2012 considers Touch UI project as Touch library.
Intellisense is working.
You can give me your feedback.

Contributor

Alphapage commented Jan 17, 2013

I found a way to bypass the slow loading of Touch UI projects.
Follow previous steps to get all projects loaded except Touch UI projects.
From there, edit each Touch UI project and add the following lines before Debug|iPhoneSimulator PropertyGroup:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>True</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>False</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoStdLib>True</NoStdLib>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>True</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <NoStdLib>True</NoStdLib>
  </PropertyGroup>

Close and reopen VS2012. All projects should be loaded else reload the unavailable projects.
Right-Click on Solution -> Properties -> Select : Configuration properties
For each UI Touch projects, replace by AnyCPU and select build if not.
You are done: unload and reload any project within seconds.

I don't know if this could cause other problems or if new limitations occurred, but it seems to work on both VS2012 and Monodevelop OSX.
VS2012 considers Touch UI project as Touch library.
Intellisense is working.
You can give me your feedback.

@Alphapage

This comment has been minimized.

Show comment
Hide comment
@Alphapage

Alphapage Jan 17, 2013

Contributor

Finally, the solution loads within 10 minutes now, but less than 5 minutes when running safemode before opening.
I wrote :"When you open the project for the first time, another feeling is that VS2012 is also waiting for some dialog box results in the background delaying the process depending on a timeout foreach dialog, but this is my opinion."
I think something is delaying the first load and my feeling seems true because when using safemode, you need to validate some dialog boxes, but without safemode VS2012 never displays any dialog box.
This is a security issue because VS2012 validates dialog boxes without prompting.

Conclusion: 50-50 , it was an issue for MvvmCross because VS2012 hangs on the configuration problem and it is a VS2012 issue because it slows down the first load anyway.
Thanks for the award.

Contributor

Alphapage commented Jan 17, 2013

Finally, the solution loads within 10 minutes now, but less than 5 minutes when running safemode before opening.
I wrote :"When you open the project for the first time, another feeling is that VS2012 is also waiting for some dialog box results in the background delaying the process depending on a timeout foreach dialog, but this is my opinion."
I think something is delaying the first load and my feeling seems true because when using safemode, you need to validate some dialog boxes, but without safemode VS2012 never displays any dialog box.
This is a security issue because VS2012 validates dialog boxes without prompting.

Conclusion: 50-50 , it was an issue for MvvmCross because VS2012 hangs on the configuration problem and it is a VS2012 issue because it slows down the first load anyway.
Thanks for the award.

@slodge

This comment has been minimized.

Show comment
Hide comment
@slodge

slodge Jan 17, 2013

Contributor

So is there a pull request you can send for this?

Contributor

slodge commented Jan 17, 2013

So is there a pull request you can send for this?

@Alphapage

This comment has been minimized.

Show comment
Hide comment
@Alphapage

Alphapage Jan 17, 2013

Contributor

Sorry, but I need to learn git and github. If you follow the steps of my workaround, then you can pull your request.
I will try to make my first pull request as soon as I can give a try to GitHub for Windows or other tools.

Contributor

Alphapage commented Jan 17, 2013

Sorry, but I need to learn git and github. If you follow the steps of my workaround, then you can pull your request.
I will try to make my first pull request as soon as I can give a try to GitHub for Windows or other tools.

@slodge

This comment has been minimized.

Show comment
Hide comment
@slodge

slodge Jan 17, 2013

Contributor

Here's what I do... http://slodge.blogspot.co.uk/2012/09/heres-how-i-setup-fork.html

But if you want to use the Git4Windows instead, then please do :)

Contributor

slodge commented Jan 17, 2013

Here's what I do... http://slodge.blogspot.co.uk/2012/09/heres-how-i-setup-fork.html

But if you want to use the Git4Windows instead, then please do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment