OfficeDev / TeamsFx

Developer tools for building Teams apps
Other
427 stars 164 forks source link

publishing keeps making subdirectories. #8405

Closed wrharper-AASP closed 9 months ago

wrharper-AASP commented 1 year ago

This screenshot pretty much says it all. Every time you do an Azure publish and it fails it seems to create more directories. It may still do it on success too, hard to tell. Also, the app keeps failing the deploy when I try to do it from another location, is this by design in some way? image

ghost commented 1 year ago

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

Alive-Fish commented 1 year ago

@wrharper-AASP Sorry for any inconvenience. Could you tell us more information for troubleshooting?

wrharper-AASP commented 1 year ago

this has happened on every update in visual studio at 17.3+ this is the official TeamsFx attached to the visual studio installer. The current GitHub says 1.2.1 for TeamsFx Project -> Teams Toolkit -> Deploy to the Cloud is what I use.

image image

Alive-Fish commented 1 year ago

Thanks @wrharper-AASP, @hund030 and @Siglud will follow up this issue next.

hund030 commented 1 year ago

@wrharper-AASP Thanks for reporting the issue. Teams Toolkit runs the build command before publishing, using the following command:

dotnet publish --output publish --configuration Release --runtime win-x86 --self-contained

According to the documentation, when specifying an output folder for the publish command, we should exclude that folder.

To work around this issue, you can first remove both the publish folder and the bin folder from your project. Then, add the following line to a PropertyGroup: <DefaultItemExcludes>$(DefaultItemExcludes);publish/**</DefaultItemExcludes>

You can find more information about the dotnet publish command and its options in this document: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#options

hund030 commented 1 year ago

This issue will be fixed in 17.7.

wrharper-AASP commented 9 months ago

I have created a bat file to work around this for the time being. For whatever reason, this is still happening:

cd PATHTOPROJECT
RMDIR "publish" /S /Q
dotnet publish --output publish --configuration Release --runtime win-x86 --self-contained
pause
hund030 commented 9 months ago

@wrharper-AASP Yes, we have resolved the issue in VS 17.7 which is currently in the preview channel. If you are using the stable channel (17.6), you may still be affected by the problem. You can try installing the VS 17.7 preview using the VS installer, Or use a work around until the stable version is released. We anticipate that the stable version will be released soon.

wrharper-AASP commented 9 months ago

I was down for almost a whole month when Blazor broke from a "stable" release. I have to be careful on these decisions now....

hund030 commented 9 months ago

@wrharper-AASP I think adding <DefaultItemExcludes>$(DefaultItemExcludes);publish/**</DefaultItemExcludes> to your .csproj file is a helpful solution that may mitigate the issue you're experiencing. Could you explain more details about how your Blazor app breaks?

wrharper-AASP commented 9 months ago

it happened to everyone, and it was a major outage on one of the Blazor versions. I'd have to go through a ton of issues to find it.

wrharper-AASP commented 9 months ago

ah, got lucky and found it towards the top: https://github.com/dotnet/razor/issues/8718 It was originally about some kind of certain project they were using, but it ended up being an issue for everyone.

hund030 commented 9 months ago

@wrharper-AASP It appears that you are suffering an issue related to Blazor framework. We suggest that you file an issue on Blazor's repository to ask for help. This repository is focused on Teams Toolkit and its associated projects, and we may not possess the expertise to address your concerns regarding the Blazor framework.

wrharper-AASP commented 9 months ago

That issue is fixed, the point is no one knew the issue was going to happen and everyone who upgraded to 16.2 went down for nearly a month unplanned. Microsoft fixed it in 16.3+, I'm just saying we need to take precautions when upgrading now.

wrharper-AASP commented 9 months ago

image

wrharper-AASP commented 9 months ago

image

hund030 commented 9 months ago

@wrharper-AASP It should be in PropertyGroup. image