Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Transferring items from one project to another

$
0
0
I am currently trying to move one project item, a document, from one Project to another using `IVsProject3::TransferItem` and `IVsSupportItemHandoff::HandoffItem`.
IVsProject3Instance.TransferItem(currentPath, newPath, null);
In the example above the `currentPath` contains the path of the document which I want to move, and newPath is path which I suspect it to be transferred to. This would be `DirectoryOfTargetProject\\NameOfFileWithExtension` and for the last parameter I passed null, since the doc tells that it is optional. 

However both of the methods I try return with the following code:
> -2146233086 which is equal to the `COR_E_ARGUMENTOUTOFRANGE` e.g. `ArgumentOutOfRangeException`.
>
> In VisualStudio I get an error message which tells me that the `newPath ` (The second parameter I passed) is out of range.

This doesn't make any sense to me since the error itself should't be thrown for a string, at least from my understanding. Is there any reason for this behavior?

Note I am currently using: `Microsoft Visual Studio Community 2019 Preview Version 16.6.0 Preview 2.0`.

Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>