보관함

mac 에서 dotnet core 개발환경 만들기 – 1

우선은 dotnet sdk를 설치 해야 한다.

dotnet 5.0 까지는 brew를 통해 설치하기가 많이 애매 했지만 6.0대로 가면서 brew를 통해 설치가 가능하다.

일단 brew를 설치한다.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew로 dotnet sdk 를 설치 한다.

brew install --cask dotnet-sdk

그리고 vscode를 설치한다

brew install --cask visual-studio-code

vscode에서 dotnet 개발을 하기 위한 확장을 설치한다.

  • .NET Core Add Reference
  • .NET Core Snippet Pack
  • .NET Install Tool for Extension Authors
  • ASP.NET Core Switcher
  • ASP.NET Helper
  • Auto Close Tag
  • Auto Fold
  • Auto Rename Tag
  • Auto-Using for C#
  • Bookmarks
  • Bootstrap 5 Snippets
  • C#
  • C# Namespace Autocompletion
  • C# Snippets
  • C# XML Documentation Comments
  • Change Language Mods
  • Code Spell Checker
  • colorize
  • CSS Flexbox Cheatsheet
  • CSS Peek
  • Error Lens
  • Font Awesome Auto-complete & Preview
  • Git History
  • GitIgnore
  • GitLens – Git supercharged
  • Highlight Matching Tag
  • HTML (C#)
  • HTML CSS Support
  • HTML End Tag Labels
  • Image preview
  • indent-rainbow
  • IntelliCode
  • IntelliSense for CSS class names in HTML
  • JQuery Code Snippets
  • jshint
  • LibMan Tools
  • Live Server
  • Markdown All in One
  • Nuget Package Manager
  • Output Colorizer
  • Svg Preview
  • SVN
  • Todo Tree

그외 dotnet 하고는 상관 없을지 모르지만 기타 필요한 확장들이 조금 더 있다.

  • Vim
  • Zoom Bar
  • file-size
  • google-search
  • Material Icon Theme

깔아야 하는 확장이 생각보다 많다.

그런데 이렇게 확장을 깔고 각종 javascript 라이브러리들을 추가 하고 나면 vscode가 맞나 싶을 정도로 느려지기 시작한다.

여기서 우리는 환경 설정에서 exclude 설정을 잘 해야 한다.

{
	"emmet.triggerExpansionOnTab": true,
	"emmet.includeLanguages": {
		"razor": "html",
		"aspnetcorerazor": "html",
		"asp": "html",
	},
	"git.enableSmartCommit": true,
	"git.autofetch": true,
	"git.confirmSync": false,
	"svn.delete.ignoredRulesForDeletedFiles": [
		".vscode"
	],
	"svn.experimental.detect_encoding": true,
	"editor.fontFamily": "D2Coding Ligature",
	"editor.renderWhitespace": "all",
	"editor.insertSpaces": false,
	"editor.formatOnType": false,
	"editor.fontLigatures": true,
	"editor.wordBasedSuggestions": true,
	"editor.acceptSuggestionOnCommitCharacter": true,
	"editor.minimap.enabled": false,
	"editor.linkedEditing": true,
	"editor.showFoldingControls": "always",
	"editor.wordSeparators": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-",
	"editor.detectIndentation": false,
	"editor.quickSuggestionsDelay": 1,
	"editor.bracketPairColorization.enabled": true,
	"editor.guides.bracketPairs": "active",
	"editor.cursorSmoothCaretAnimation": true,
	"editor.suggestSelection": "first",
	"editor.suggestOnTriggerCharacters": true,
	"editor.quickSuggestions": {
		"comments": "on",
		"strings": "on",
		"other": "on"
	},
	"debug.onTaskErrors": "abort",
	"debug.toolBarLocation": "docked",
	"workbench.list.smoothScrolling": true,
	"workbench.tree.indent": 20,
	"workbench.tree.renderIndentGuides": "always",
	"workbench.settings.editor": "json",
	"workbench.editor.enablePreview": false,
	"workbench.editor.enablePreviewFromQuickOpen": false,
	"workbench.startupEditor": "newUntitledFile",
	"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
	"search.followSymlinks": false,
	"search.exclude": {
		"**/.DS_Store": true,
		"**/.git": true,
		"**/.idea": true,
		"**/.svn": true,
		"**/.vscode": false,
		"**/.zip": true,
		"**/*.min.js": true,
		"**/*.xcodeproj": true,
		"**/*.xcworkspace": true,
		"**/bower_components": true,
		"**/build": true,
		"**/class": true,
		"**/coverage": true,
		"**/locks": true,
		"**/logs": true,
		"**/Migrations": true,
		"**/node_modules": true,
		"**/Pods": true,
		"**/tmp": true,
		"**/venv": true,
		"**/wwwroot/lib": true,
		"**/yarn.lock": true
	},
	"files.encoding": "utf8bom",
	"files.autoGuessEncoding": true,
	"files.exclude": {
		"**/node_modules": true,
		"**/bower_components": true,
		"**/.zip": true,
		"**/.git": true,
		"**/.svn": true,
		"**/.DS_Store": true,
		"**/.idea": true,
		"**/.vscode": false,
		"**/logs": true,
		"**/locks": true,
		"**/class": true,
		"**/tmp": true
	},
	"files.watcherExclude": {
		"**/.git/objects/**": true,
		"**/node_modules/**": true,
		"**/node_modules/*/**": true,
		"**/wwwroot/lib/**": true
	},
	"files.associations": {
		"*.emProject": "xml"
	},
	"gitlens.currentLine.enabled": false,
	"gitlens.advanced.messages": {
		"suppressImproperWorkspaceCasingWarning": true
	},
	"fontAwesomeAutocomplete.patterns": [
		"**/*.cshtml"
	],
	"fontAwesomeAutocomplete.disableTriggerWordAutoClearPatterns": [
		"**/*.cshtml"
	],
	"todo-tree.highlights.defaultHighlight": {
		"opacity": 50,
		"gutterIcon": true
	},
	"todo-tree.highlights.customHighlight": {
		"FIXME": {
			"icon": "bug",
			"iconColour": "red",
			"foreground": "white",
			"background": "red"
		},
		"WARN": {
			"icon": "alert",
			"iconColour": "orange",
			"foreground": "orange",
			"background": "white"
		},
		"TODO": {
			"icon": "check",
			"iconColour": "green",
			"foreground": "green",
			"background": "white"
		},
		"REVIEW": {
			"icon": "eye",
			"iconColour": "lightblue",
			"foreground": "black",
			"background": "cyan"
		}
	},
	"todo-tree.general.tags": [
		"FIXME",
		"WARN",
		"TODO",
		"REVIEW"
	],
	"liveServer.settings.donotShowInfoMsg": true,
	"gitHistory.showFileHistorySplit": false,
	"docomment.syntax": "single",
	"docomment.activateOnEnter": false,
	"autofold.pack": false,
	"autofold.types": [
		{
			"ext": ".js",
			"level": 2
		},
		{
			"ext": ".cs",
			"level": 3
		}
	],
	"[javascript]": {
		"editor.defaultFormatter": "vscode.typescript-language-features"
	},
	"[jsonc]": {
		"editor.defaultFormatter": "vscode.json-language-features"
	},
	"javascript.suggestionActions.enabled": false,
	"typescript.suggestionActions.enabled": false,
	"html.autoClosingTags": true,
	"editor.formatOnSave": true,
	"colorize.exclude": [
		"**/wwwroot/lib",
		"**/.git",
		"**/.svn",
		"**/.hg",
		"**/CVS",
		"**/.DS_Store",
		"**/.git",
		"**/node_modules",
		"**/bower_components",
		"**/tmp",
		"**/dist",
		"**/tests"
	],
	"todo-tree.filtering.excludeGlobs": [
		"**/node_modules",
		"**/wwwroot/lib"
	],
	"html-css-class-completion.excludeGlobPattern": "**/*.min.*",
	"html.format.templating": true,
	"[html]": {
		"editor.defaultFormatter": "vscode.html-language-features"
	},
	"html.format.wrapLineLength": 120,
	"editor.rulers": [
		120
	],
}

많은 개인적인 설정을 덜어내기는 했지만 dotnet으로 개발하는데 필요한 옵션들을 대부분 추가했고 특히 속도때문에 exclude 해야 하는 부분들을 포함해봤다.

특히 위에 setting.json을 보면 exclude 하는 경로중에 **/wwwroot/lib 라는 경로가 있는데 이는 내가 libman 을 통해 javascript 라이브러리를 wwwroot/lib 아래에 위치하게 하기 때문이다.

{
	"version": "1.0",
	"defaultProvider": "unpkg",
	"libraries": [
		{
			"library": "@fortawesome/fontawesome-free@latest",
			"destination": "wwwroot/lib/_fortawesome"
		},
		{
			"library": "tinymce@latest",
			"destination": "wwwroot/lib/tinymce"
		}
	]
}

 

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

  

  

  

이 사이트는 Akismet을 사용하여 스팸을 줄입니다. 댓글 데이터가 어떻게 처리되는지 알아보세요.