Question

In the current project, the solution is already existing, the solution has like 5 features and each feature deploys different things.

The current development never used feature versions. So I suppose version is 0.0.0.0 for all features.

I already made a logic change in one of the .ascx.cs files. I want to upgrade that change only.

I cant retract and redeploy the solution, that will delete lists data, etc.

I suppose I can add a version to the feature.xml that holds that file and put version 2.0.0.0 Then create a feature upgrading event receiver and just call Feature.Upgrade?

How else would you do it?

Thanks

Was it helpful?

Solution

Esteban,

The .CS code is compiled into the assembly. The actual .cs file is never deployed to SharePoint, so the only thing you would need to do is rebuild the WSP solution and upgrade it. This will update the assembly, recycle the app pool, and deploy your change to any web application.

Beyond that, Ashish is right that removing a solution will not remove created artefacts, but if you're using featuredeactivating or featureuninstalling event receivers, these will fire if you remove the solution, so it's better to upgrade when you are in fact upgrading.

Keep in mind that you cannot add new files to a solution when upgrading a WSP, but that this does not apply to .cs files because these are all compiled into one assembly in any case. So, you cannot add new features to an upgraded WSP, but you can add new class files because these will be compiled into the existing .dll.

.b

OTHER TIPS

When you retract the solution, it will not delete the list data. For similar changes (update code behind), I have redeployed the solution many times without any issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top