我試圖使用dotnet手錶,但是我的項目引用了nuget包,它使用$(SolutionDir)在prebuild事件中複製一些文件。這是有道理的,因爲dotnet watch在項目級運行,所以$(SolutionDir)不存在。有沒有什麼辦法可以爲整個解決方案運行dotnet watch?
0
A
回答
1
我創建了一個批處理腳本watch.bat
call SET ASPNETCORE_ENVIRONMENT=Development
call SET SolutionDir=%~dp0\\..\\..\\
call dotnet watch run
添加在package.json
的腳本:
"scripts": { "dotnetwatch": "watch.bat" }
現在我可以從CLI像這樣運行:
npm run dotnetwatch
或從內部視覺工作室與以下launchsettings.json
配置文件:
"dotnet watch": {
"executablePath": "watch",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
這不是一個理想的解決方案,但至少它對我來說足夠好。
0
從dotnet-watch 2.0.0-preview2開始,無法在解決方案文件上運行dotnet監視。但是,您可以爲觀察者構建一個自定義「項目」,以觀看多個項目。有關如何執行此操作的完整示例,請參閱https://github.com/aspnet/DotNetTools/tree/rel/2.0.0-preview2/samples/dotnet-watch/WatchMultipleProjects。
+0
它並不真正回答我的問題。在我的項目中,我必須定義$(SolutionDir)屬性。有了msbuild,我可以做msbuild/p:SolutionDir =無論在dotnet cli中,它似乎都不起作用。 – MistyK
相關問題
- 1. firefox only:TypeError:toggler is undefined
- 2. ws:path is undefined
- 3. fb is undefined
- 4. ajaxupload el is undefined
- 5. req.body.name is undefined
- 6. ko.mapping is undefined
- 7. JQGrid - ccur is undefined
- 8. this.p is undefined jqgrid
- 9. Socket.io「Listeners is undefined」
- 10. Error:identifer「blockIdx」is undefined
- 11. 「$ .support is undefined」
- 12. Vue ... $ is undefined
- 13. Greasemonkey:「waitForKeyElements is undefined」
- 14. TypeError:sally is undefined
- 15. React this.setState is undefined
- 16. React this.state is undefined?
- 17. $ routeParams is undefined
- 18. extjs - 'Store is undefined'
- 19. this._waiting is undefined
- 20. 「this」is undefined
- 21. req.body is undefined - sequelize
- 22. Ext.JS Store Record is undefined
- 23. req.body is undefined mean app
- 24. React-Native:_reactNativeFacebookLogin.FBLoginManager.loginWithPermissions is undefined
- 25. Javascript onclick getvalue is undefined
- 26. Flot plothover - pos.y is undefined
- 27. JavaScript AmCharts「TypeError:r.axes [t.valueAxis.id] is undefined」
- 28. jquery this attr href is undefined
- 29. jquery錯誤「u is undefined」
- 30. Node.js,express,html form req.body is undefined
這是你在找什麼? https://stackoverflow.com/questions/3439060/how-can-i-evaluate-vs-build-command-macros –
@SurajS它會顯示$(SolutionDir)的值,但我知道它是空的。這對我的情況會有什麼幫助? – MistyK