WaelHamze / dyn365-ce-vsts-tasks

VSTS Extension for Dynamics 365 Customer Engagement
https://marketplace.visualstudio.com/items?itemName=WaelHamze.xrm-ci-framework-build-tasks
GNU General Public License v3.0
117 stars 56 forks source link

Apps not included Packing a solution containing apps #140

Closed JezNorton closed 4 years ago

JezNorton commented 4 years ago

Hi Wael,

There seems to be an issue with this. When we use the solution packager directly this doesn't happen

WaelHamze commented 4 years ago

@JezNorton I presume you are comparing this to the task? Are you using the same version of the solution packager in both?

JezNorton commented 4 years ago

@WaelHamze Hi, yes when packed manually using the solutionpackager it's fine. I selected SDK version 9 on the task. I did think perhaps it's using an outdated version of the packager, IDK.

WaelHamze commented 4 years ago

@JezNorton when the task runs it will output the version of the solution packager to the console. Did you compare that with version that works fine locally?

JezNorton commented 4 years ago

@WaelHamze Hi, I'm using assembly file version 9.0.4.4 locally, the task is using 9.1.0.24

WaelHamze commented 4 years ago

@JezNorton still facing issues? The solution packager should be at least version now too. Do you need more control over the version in the task?

tdahnert commented 4 years ago

I believe I may be having a similar issue. When I run a solution through the package task and then expand the artifact the AppModule folder is missing. If I package the same solution folder locally and then expand it using solution packager the AppModule folder is there. I have MSCRM Pack Solution version 10.0.5 which reports it is running solution packager version 9.1.0.29. The version I'm running locally is also 9.1.0.29. These are the parameters it runs with in the task

/action:Pack /zipFile:"d:\a\96\b\Levridge.zip" /folder:"d:\a\96\s" /packageType:Both /errorlevel:Verbose /map:"d:\a\96\drop\s\SolutionPackager\SolutionPackagerMapping.xml"

However, if I run the same process with the same solutionpackagermapping and source directory in 9.0.4.4 (just another version I had laying around) the AppModule folder is there when I unpack the artifact. Is there any way to choose what version of the core tools the task uses? Is there a way to downgrade the extension to an earlier version to test further? I'll research that second question myself, but I've not attempted that before. Thanks Wael, Love your stuff!

tdahnert commented 4 years ago

I wanted to mention that the issue with the missing folder results in the following error when you try to import the managed solution to another environment. "##[error]Solution import Failed. Error: Cannot add a Root Component {YourComponentName} of type 80 because it is not in the target system."

LycraLout commented 4 years ago

We've had this problem too.

I think it is a problem with the version of SolutionPackager in v10 of the Task. I can't remember the version numbers off the top of my head but using the same that is in v10 of the Task and running locally produced the same issue. So we are using Task version 9.* instead. That one works fine.

tdahnert commented 4 years ago

@LycraLout ,

Can you give any advice on how to switch back to that task version? I don't see the ability to switch back in the version drop down.

LycraLout commented 4 years ago

The Task Version defaults to 10. Drop down to 9 and you should be good. image

WaelHamze commented 4 years ago

@tdahnert I would use the latest version of solution packager task. This has the latest tool from MS. You still facing issue with this? Did you try to run solution packager locally?

LycraLout commented 4 years ago

FWIW, I ran the solution packager locally and experienced the same behaviour. My app was missing from the resultant packed solution despite being in the solution.xml and the file system.

WaelHamze commented 4 years ago

@LycraLout there is a new version of solution packager released recently and I included it in this task.

You might want to give this a try and/or raise your issue with the vendor.

It seems the issue here is related to solution packager itself rather than task so I will close this issue now.

There is another issue open for allowing consumer to be able to change the version of the solution packager which you can follow.

https://github.com/WaelHamze/dyn365-ce-vsts-tasks/issues/131

LycraLout commented 4 years ago

I have Solution Packager Version: 9.1.0.41 showing for my v10.* of the Task. This is still displaying the issue. I keep an eye on it by using this version of the Task in our CI build. Our production build uses the old version.

In the CI build, when I look down the log of Pack Solution Task, I can see this in the Missing Dependencies output

Type='SiteMap', Id (or schema name)='SiteMap-cfm_CFMMDApp'.
Type='AppModule', Id (or schema name)='AppModule-cfm_CFMMDApp'.

That's our custom App and SiteMap.

Version 9.* of the Task appears to be using 9.0.0.2090 of the solution packager. This successfully packs the App and SiteMap.

I appreciate this is a solution packager problem and not a problem of the Task. Happy this is closed. Downgrading is working for us at the moment. I'll keep an eye on the MissingDependencies and will upgrade when it's clear.