Reputation: 97
I am trying to publish a new Blazor Server project (with docker support) to Azure App Service Container using Visual Studio 2019. It builds and runs just fine locally. When I go to publish, I receive the error:
The "GenerateEnvTransform" task failed unexpectedly.
System.IO.DirectoryNotFoundException: Could not find a part of the path '[PathToProject]\obj\Debug\netcoreapp3.1\PubTmp\EnvironmentWithLocation.transform'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)
at System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings)
at System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options)
at Microsoft.NET.Sdk.Publish.Tasks.GenerateEnvTransform.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() BenjiWorldServer2 0
I have also tried with different framework versions, including .Net 5. I have also tried changing the configuration from dev to release. This is just a bare-bones project trying to setup, I didn't touch any of the default template code files. I am using Windows 10 with the Docker Windows App running.
Upvotes: 0
Views: 182
Reputation: 22082
Update your docker and vs2019 to the latest version.
I'm not sure why you get this error. According to your description, create and publish the application, I did not encounter the same error as you, so I suggest you try again after updating.
Tips
Make sure that the version of your app service is consistent with the version of the project, for example, both are .net 5.
Upvotes: 0