I am a novice in sharepoint 2013.

I have created a Sharepoint 2013 Solution using "Empty Project" as my template and added two aspx pages.

When deploying the solution using VS2012 the solution gets deployed and worked perfectly. When I use powershell to deploy the solution on this same web application also it works as expected.

The problem arises when I deploy the solution using powershell on a different web application. It deploys perfectly but then I get page not found error even though I can see the aspx pages in the file system. If I deploy the solution using VS2012 on this same web application it works perfectly and then even if I use power shell in my subsequent attempts it works fine.

I am really stumped and have no clue as to where I am making a mistake.
What special does VS do while deploying the solution for the first time?

Below is my powershell script

Add-PSSnapin Microsoft.Sharepoint.Powershell
Import-Module WebAdministration

$webURL = read-host -prompt ‘Sharepoint Web Application URL (Eg: http://myurl.com):’;
$rootFilePath = read-host -prompt ‘Full File Path of wsp file (Eg: C:\Packages):’;
$wspFilePath = $rootFilePath + '\my.wsp'

$spWeb = Get-SPWeb -Identity $webURL

$pool = (Get-Item "IIS:\Sites\myapplication"| Select-Object applicationPool).applicationPool

Restart-WebAppPool $pool

write-host "App Pool resetted."

Add-SPSolution $wspFilePath -Confirm

Install-SPSolution -Identity my.wsp -GACDeployment -WebApplication $webURL -Force

write-host "Solution deployed."

The solution gets deployed perfectly but I am unable to browse my pages.

  • You do not need to restart the application pool manually when deploying a solution. Check your ISS to make sure that the webapplication is not stopped. Commented Jan 22, 2015 at 7:25
  • I have checked and my application is perfectly up and running :(
    – Sandesh
    Commented Jan 22, 2015 at 9:23
  • what is the error your getting when loading the page? 404?
    – Ali Jafer
    Commented Jan 22, 2015 at 9:55
  • also what does it show when you look at the uls log files?? is the wsp only deploying aspx pages or other assests?
    – Ali Jafer
    Commented Jan 22, 2015 at 10:03
  • I get error 404 and hence there is no correlation id because of which I can't find any correlation id.
    – Sandesh
    Commented Jan 22, 2015 at 10:06

1 Answer 1


On first deploy using visual studio, the solution feature is also activated. This step is not executed on deployment via powershell.. even in your script.

Activate the feature through script or UI and it should work fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.