avdbrink / VSTS-SSRS-Extention

VSTS task for deploying SSRS folders, solutions and projects
MIT License
2 stars 3 forks source link

File path for devenv.com need to be fixed for different version of visual studio #2

Open syedhamjath opened 5 years ago

syedhamjath commented 5 years ago

If multiple version of visual studio is installed the path of the $devenv variable becomes invalid hence add a property to get IDE Visual studio version and use the appropriate while deployment. This removes the need for search and deployment is faster.

2019-08-06T12:21:52.9604292Z Project file path: C:\azagent\A1\_work\r2\a\ReportSolution\SsrsReportProject\SsrsReportProject.sln
2019-08-06T12:29:09.5053512Z Devenv.com not found on server: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.com
2019-08-06T12:29:09.5281533Z ==================================================================
2019-08-06T12:29:09.5309492Z Initiate C:\azagent\A1\_work\r2\a\ReportSolution\SsrsReportProject\SsrsReportProject\SsrsReportProject.rptproj
2019-08-06T12:29:09.5315431Z ==================================================================
2019-08-06T12:29:09.5322068Z Set config for C:\azagent\A1\_work\r2\a\ReportSolution\SsrsReportProject\SsrsReportProject\SsrsReportProject.rptproj
2019-08-06T12:29:09.6580026Z Deploy C:\azagent\A1\_work\r2\a\ReportSolution\SsrsReportProject\SsrsReportProject\SsrsReportProject.rptproj
2019-08-06T12:29:09.6639218Z Deploying project
2019-08-06T12:29:09.6686613Z start C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.com  "C:\azagent\A1\_work\r2\a\ReportSolution\SsrsReportProject\SsrsReportProject\SsrsReportProject.rptproj" /deploy "" /out "C:\azagent\A1\_work\r2\a\ReportSolution\SsrsReportProject\SsrsReportProject\ErrorLog.txt"
2019-08-06T12:29:09.8224760Z ##[error]Task_InternalError This command cannot be run due to the error: The system cannot find the file specified.
2019-08-06T12:29:09.8327015Z Ending DeploySSRSTask
2019-08-06T12:29:09.9055316Z ##[section]Finishing: SSRS Deploy of project $(System.DefaultWorkingDirectory)/ReportSolution/SsrsReportProject/SsrsReportProject.sln
jbarber2016 commented 5 years ago

If there's multiple paths that devenv.com exists. The issue in the powershell script is $devenv = (Get-ChildItem C:\ -Filter "devenv.com" -Recurse -Name) can return multiple paths. and then it blindly does $devenv = "C:\$devenv". A simple fix in the powershell can check if there's multiple and if there is it would grab the first. I might do a clone of this repo and publish it, or do PR and hope this gets fixed.

jbarber2016 commented 5 years ago

Created a pull request that will fix the problem. Cross our fingers that the owner will push out the update.

jbarber2016 commented 5 years ago

@syedhamjath I created another Extension and published it on Azure Devops. It's called SSRS Deploy V2. Feel free to check it out. You'll need to remove the extension that's for this site. I've added more features, such as specifying Server Version (SSRS2008, SSRS2016, etc)

avdbrink commented 5 years ago

Hi! I merged the pull request and I'm building the marketplace package right now. @jbarber2016 I'd be happy to accept more pull requests to see if the other additions you've made can be merged into this component as well if you'd like to. Arno

jbarber2016 commented 5 years ago

@avdbrink I was looking into replacing devenv.com with msbuild. There's now support for using msbuild. The reason is I have seen messages from devenv.com that will say license has expired for Visual Studio. The hard part though is figuring out how to replace the variables for Server Url and all the others. Perhaps this is something we can both solve.

crimdon commented 5 years ago

I've created #6 so that you can enter the path to devenv via a variable.