简体   繁体   中英

How to open .slnf file under macOS using Visual Studio?

I have a huge .NET core project consisted of one.sln file and much smaller.slnf files. I saw this Article which says that I can use

devenv /donotloadprojects MySln.sln

shell command in order to open my solution without necessary load every project inside. This seems to be a shell command and as far as I know, it's not possible to execute shell commands under macOS.

Another option I've tried is to load the.slnf file straight to Visual Studio. This results in opening the actual file in text format and not the filtered solution.

I'll be happy to understand more how you guys usually open.slnf files under macOS.

Update for March 2021:

SLNF files are now supported in Visual Studio for Mac. You can learn more on this blog post: https://devblogs.microsoft.com/visualstudio/visual-studio-2019-for-mac-version-8-9-is-now-available/#solution-filter-slnf-support

In this release of Visual Studio for Mac, we've added a popular request: support for solution filtering . Solution filtering lets you open a solution with only selective projects loaded. Loading a subset of projects in a solution decreases solution load, build, and test run time, and enables more focused review.


Original answer (out-of-date):

SLNF files are not supported on Visual Studio for Mac at this time, which explains why you see it opened as a text file.

As commenter Neil mentioned, if you open the SLN in Visual Studio for Mac and unload certain projects, then that state will be remembered the next time you open the solution. As far as I know, this is the best you can get right now. In my view, it's a very acceptable solution - I use it all the time.

You can run Visual Studio for Mac from the command-line, but it doesn't seem to have any options related to what you want.

Here's how to launch VS from the command line ("Terminal") on a Mac:

  1. Press CMD+Space to load Spotlight
  2. Type "terminal" and press Enter
  3. Run this command: /Applications/Visual Studio.app/Contents/MacOS/VisualStudio ~/Documents/MySolution/MySolution.sln

You can see the command-line options by passing in the --help parameter to the command line, but there are only a few options, none of which have to do with configuring solution load.

It appears that the VS for Mac team is considering this issue, which you can track here: https://developercommunity.visualstudio.com/content/idea/586209/filtered-solution-for-visual-studio-2019-for-mac.html

You can also vote on the issue or provide additional feedback and comments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM