You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add-Migration unable to link scripts with UNC path #14781
When running Add-Migration for the project located on a network folder, migration fails with following error:
Add-Migration : Cannot add the link because the source file '\\\\Network Share\Folder\Solution\Project\Migrations\00000000000000_Create.cs' cannot be found.
At line:1 char:1
+ Add-Migration Create
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Add-Migration], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Add-Migration
So, it seems that problem is in two extra backslashes in UNC address that Add-Migration is trying to use
\\\\Network Share\Folder
rather then
\\Network Share\Folder
Files are actually created and can be found in network folder, but not added to project.
If generated files manually added to Project though Add.. - Existing Item and then Update-Database executed - Migration completes successfully.
If Project is open from same location but with Mapped Network Drive rather then UNC - it works fine.
in ef/Json.cs#L14-L17? I can see that we are trying to espcape the backslashes for JSON, so if we need to keep this, perhaps at this location in the PMC we could double-check the filename to make sure that it doesn't have double-double backslashes? Thoughts?
I've got an idea that doesn't require most of what I said before. I'm testing it now. @bricelam am I good to open a PR once I've validated the changes?
We can no longer reproduce this and believe that the underlying issue has been fixed. If you are still hitting this issue with EF Core 5.0 or later, then please file a new issue and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.
Activity
[-]Add-Migration unale to link scripts with UNC path[/-][+]Add-Migration unable to link scripts with UNC path[/+]6 remaining items
Psypher9 commentedon Dec 12, 2019
My cursory look over this seems to suggest that the calls to the EnvDTE here would be throwing this exception.
Is this possibly happening because of this:
in ef/Json.cs#L14-L17? I can see that we are trying to espcape the backslashes for JSON, so if we need to keep this, perhaps at this location in the PMC we could double-check the filename to make sure that it doesn't have double-double backslashes? Thoughts?
Psypher9 commentedon Dec 20, 2019
I've got an idea that doesn't require most of what I said before. I'm testing it now. @bricelam am I good to open a PR once I've validated the changes?
bricelam commentedon Jan 2, 2020
Always feel free to submit PRs!
ajcvickers commentedon Aug 24, 2020
We can no longer reproduce this and believe that the underlying issue has been fixed. If you are still hitting this issue with EF Core 5.0 or later, then please file a new issue and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.