-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes 1218: Welcome Card does not display on non-Windows environments #1223
Conversation
- use Path.Combine to build file path to welcomeCard.json
@@ -210,7 +210,9 @@ private Activity CreateResponse(Activity activity, Attachment attachment) | |||
// Load attachment from file. | |||
private Attachment CreateAdaptiveCardAttachment() | |||
{ | |||
var adaptiveCard = File.ReadAllText(@".\Dialogs\Welcome\Resources\welcomeCard.json"); | |||
string[] paths = {".", "Dialogs", "Welcome", "Resources", "welcomeCard.json"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgellock What is this? A comment explaining why this is necessary would be good here. (this is weird)
Windows + Azure. |
I don't understand your comment. You can't simply hard code file paths in source code that is expected to run on OS's other than windows. e.g. macOS for local development, Linux distros for deployment. The code as is simply doesn't run on non-windows OSs. what additional information do you need to understand the code change? |
Sorry, my 'Windows + Azure' comment was facetious. In seriousness, I've just never seen the syntax here. A requirement of concatenating folder names to retrieve a file at run-time. Maybe I'm just ignorant of this required method of cross-platform path resolution and it will be obvious to more informed developers. |
Fixes #1218
Proposed Changes
Testing
Build and run on macOS
Should see a welcome card as soon as Emulator connects to the Bot