Reset profile version on uninstall add-on - plone

I have a default profile containing some upgrade steps (1.0.0 -> 1.0.3).
This is its metadata.xml:
<?xml version="1.0"?>
<metadata>
<version>1.0.3</version>
<dependencies>
<dependency>profile-plone.app.dexterity:default</dependency>
</dependencies>
</metadata>
I added an uninstall profile that removes the custom catalog added by default profile and so on.
So, I can Deactivate my add-on, Activate it and run again the Upgrades and all the configuration is fresh again.
How can I on uninstall to unset the profile version to something like 0.0.1 in order to get rid of manually running the upgrade steps again on reactivating the add-on? What I need is: with Deactivate + Activate the add-on to have all the configuration done, without going to portal_setup Upgrades, show old rerun...

Solved adding post_handler on register profile (also simplified the upgrades steps - all in on now, metadata version: 1.1):
<genericsetup:registerProfile
name="default"
title="my.addon"
directory="profiles/default"
description="Installs the package."
provides="Products.GenericSetup.interfaces.EXTENSION"
post_handler=".upgrades.evolve11.run"
/>
In upgrades.evolve11.run I have the code for configuring the catalog. So, reinstalling the add-on all needed operations are done.

Related

dotnet tool install -g unable to resolve

I have the .NET 5 SDK installed, but I do not have Visual Studio installed.
Whenever I tried to perform a tool installation, example dotnet tool install -g csharprepl, it always results in:
error NU1100: Unable to resolve 'csharprepl (>= 0.0.0)' for 'net5.0'.
error NU1100: Unable to resolve 'csharprepl (>= 0.0.0)' for 'net5.0/any'.
The tool package could not be restored.
Tool 'csharprepl' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
How do I use dotnet tool install in the absence of Visual Studio?
I had this same problem from a fresh install of win10/.netcore (without Visual Studio) - it seems that the default NuGet.config doesn't have the package sources setup by default (at least for me).
To resolve this, I added the following packageSource config at %AppData%\NuGet\
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
Edit: Additionally, you may need to download NuGet.exe to a tools folder, and add this to your PATH to use nuget.

Not updated module version in Magnolia

What could be a reason for not updated module version in Magnolia 5.7
In Magnolia java project I have submodule with XML descriptor in META-INF/magnolia/mymodule.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "module.dtd" >
<module>
<name>mymodule</name>
<displayName>mymodule</displayName>
<description>my module</description>
<version>${project.version}</version>
<!-- <version>1.3</version> -->
<dependencies>
<dependency>
<name>core</name>
<version>5.7.4/*</version>
</dependency>
</dependencies>
</module>
When I rebuild the whole project with version changed in project maven pom.xml and deploy on a server I don't see an updated version in Magnolia's Author configuration console. I have to manually remove the old version node in the configuration console (remove JCR node) and then restart the server. After these steps, I can confirm the new version in the configuration console. Which is a pain if you have to deploy to several dev/stage/prod environments needless to say that I have no access to a public instance in a production environment.
The problem with not updated version sounds like not important, but I'm also not seeing new or renamed pages associated with this module. They appear only if I force to reload module by removing version.
One additional detail which may help identify the problem: I can delete version node in JCR, but can NOT delete the whole module node. I receive an error message "Level 1 and 2 nodes in config workspace cannot be unpublished".
What version do you see in the config:/modules/your_module/version before you delete it? Is it lower than version number of version you are trying to install? I would suspect that it's same or higher. Ie you are trying to reinstall same version or downgrade the version. Neither of those is supported hence it doesn't trigger the installation process. Or perhaps you are trying to move up from SNAPSHOT to full version for which there's no install delta either.
As for the warning you get when trying to delete those nodes, it is on purpose. You are not supposed to be deleting those nodes as a normal user since you could cause breakage of dependent (public) instances. Only as admin (via JCR Browser) you are allowed to delete, assuming you know what and why you are doing.

Updating VS Extension from 2015 to 2017 (VSIX v3) makes the package invalid

I have an older extension that i would like to get to work in VS 2017. To be able to do this i understand that i will have to use the new VSIX Manifest v3. The extension works fine in 2015 Update 3. To update it I've done the following:
Open the extension source in VS2017. I'm prompted to do a one-time upgrade, which is completed successfully
Use NuGet to update the Microsot VSSDK BuildTools from 14.x to 15.x
Add the Prerequisite block to the source.extension.vsixmanifest file containing Microsoft.VisualStudio.Component.CoreEditor
Update the Installation target to also support the new Visual studio like so
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
Builds successfully, but once i open the vsix file in my debug folder, get a message telling me
The file is not a valid VSIX package
If i open up the file using WinRAR i can see that the two mandatory files catalog.json and manifest.json is not in there as they are supposed to in the new v3 format.
What am i missing here ?
It turned out that my problem was, that inside the vbproj file (or csproj for most others) there was an import at the top like so:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" />
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props')" />
....
As you can see this project file has imports for both the new version and the old one of the BuildTools. I'm not sure why this happens, as all i did was update the VSSDK BuildTools via NuGet. I also tried to completely uninstall the BuildTools ticking Force uninstall but it seems to have remained through everything I tried.
So if you experience similar problems, look at your vbproj/csproj file if it has imports for older versions of the Microsoft.VSSDK.BuildTools
You must also upgrade the BuildTools package, the error you get indicate that this did not happen: https://learn.microsoft.com/en-us/visualstudio/extensibility/how-to-migrate-extensibility-projects-to-visual-studio-2017

can't install google map control in ASP with NuGet

When I click install in the NuGet packages manager the screen looks like it flashes for a split second and does nothing, if I look in installed packages there are no packages installed. However it does add this line to the web.config file
<add tagPrefix="artem" namespace="Artem.Google.UI" assembly="Artem.Google" />
since the package is not installed properly I can't use the artem map control. I have created a new project and installed it fine so it is something in my current project that I need to change that is not allowing me to get it installed. The things I have done so far:
1. Browsed to the packages file in my project and deleted the GoogleMapControl.6.1 folder.
2. Removed the line from the web.config folder.
3. Removed the reference to Artem.Google in my project.
4. Cleared package cache which had google maps file in it.- Manage Nuget Packages - Settings - PackageManager - General - Clear Package Cache.
Then tried to reinstall from manage Nuget Packages - Google Map Control.
Now I click install and it looks like it installs ok has a green tick next to it, then I try and add a :
<div>
<artem:GoogleMap ID="GoogleMap2" runat="server"></artem:GoogleMap>
</div>
GoogleMap is not a know element, no Artem tools in the toolbox and if I go to the package manager and click on installed packages, there is nothing there. So it is not installing fully somehow. Any ideas?
These are the steps I followed to fix the problem
Browse to the packages file in the project and delete the GoogleMapControl.6.1 folder.
Remove the line from the web.config folder.
Remove the reference to Artem.Google in the project.
Clear package cache which has google maps file in it.- Manage Nuget Packages - Settings - PackageManager - General - Clear Package Cache.
Delete the packages.config file
install with the Package Manager Console run:
PM> Install-Package GoogleMapControl -Version 6.1.0
Add <%# Register assembly="Artem.Google" namespace="Artem.Google.UI" tagprefix="artem" %> to top of asp page where the maps will be used.
Add to body of this page.

Umbraco 7.2 cannot add controller

I'm trying to add a controller to the Controllers folder in my Umbraco 7.2 project (I've created a new empty ASP.NET MVC 4 in VS2013) but I'm getting the error
Could not load file or assembly 'ClientDependency.Core, Version=1.7.1.2, Culture=neutral, PublicKeyToken=null` or one of its dependencies. The system cannot find the specified file.
Why is this?
Normally if you add umbraco to your project, it will also add ClientDependency as a DLL reference. You should check if you have these DLL's in your bin folder.
I am pretty sure you don't have them.
IF you have the dll's in your BIN folder, it's the wrong version. In that case you need to clarify your setup more indepth.
This is a known issue in Umbraco 7.2.0 and 7.2.1 (and probably others). It has been fixed on 7.2.2 but even when/if you update you might still experience the issue.
Let's not follow the following workaround because it will put your website at risk. Read this: http://umbraco.com/follow-us/blog-archive/2015/2/5/security-alert-update-clientdependency-immediately
The suggested workaround is to run the following command in the Package Manager Console:
Uninstall-Package ClientDependency -Force
And once the uninstall is done:
Install-Package ClientDependency -Version 1.7.1.2
Source: http://issues.umbraco.org/issue/U4-5996 and https://our.umbraco.org/forum/getting-started/installing-umbraco/38333-Error-creating-Controller-in-Umbraco-v6?p=2#comment169649
Your only 2 options are really:
Update to Umbraco >= 7.2.2: Update-package UmbracoCms
Add your controllers as classes and manually inherit from Controller or UmbracoController (or other base controller classes you want to use)
I had the same problem tonight. I changed the versions in packages.config to the following:
<package id="ClientDependency" version="1.7.1.2" targetFramework="net45" />
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net45" />
Make sure the bin dir matches and you should be good to go. You might need to shutdown the project in VS and reopen it too. If you run into the same issue with EntityFramework, change to 5.0.0 and make sure the correct version is in your bin dir.
Upgrading the umbraco mvc to the latest version(v7.2.2) solves the problem.
I use Nuget Package Manager v2.8.50926.663 and Visual Studio 2013.
Hope this helps you as well.

Resources