In my Elements.xml file I have the following:
<UrlAction Url="~site/_layouts/test/page.aspx?ListId={ListId}&ItemId={ItemId}&ItemUrl={ItemUrl}"/>
When the ECB item is selected I get the following error.
The Web application at localhost:81/Shared Documents/Hello.docx could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
When I goto to the url localhost:81/Shared Documents/Hello.docx the file is there. When I go to localhost:81/_layouts/test/page.aspx the page is there. I am a little confused how I can be getting this error when I am using the {name}.
Update
With more investigation it is my page.aspx that is causing the error.
var itemUrl = Request.QueryString["ItemUrl"];
var siteURL = "";
var inputPath = siteURL + itemUrl;
var job = new ConversionJob("Word Automation Services") { UserToken = Site.UserToken }; // This is the default name of the service application
// Set the settings
if (Site.SiteSubscription != null)
job.SubscriptionId = Site.SiteSubscription.Id;
job.Settings.OutputFormat = SaveFormat.PDF;
job.Name = "Conversion from Convert Item Menu";
//var pdf file
var newFile = siteURL + itemUrl.Replace(".docx", ".pdf");
// Add the file
job.AddFile(inputPath, newFile);
It is failing on the job.AddFile line.
inputpath = http://localhost:81/Shared Documents/Hello.docx
newFile = http://localhost:81/Shared Documents/Hello.pdf
The error is
System.IO.FileNotFoundException: The Web application at http://localhost:81/Shared Documents/Hello.docx could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
If I browse to localhost:81/Shared Documents/Hello.doc the file is there.
Update 2
If i change the port to 80 in iis for the site it then begins to work. I initially set up SP on port 80 but then changed it to port 81 in iis.
