Sitecore Glass.Mapper.Sc vs Glass.Mapper.Sc.Core - sitecore

Hi Fellow Sitecoryians ,
I'm in the process of upgrading a website sitting on Sitecore 7.1 rev140130 webforms to Sitecore 8.2rev160729 MVC-5 / Webforms hybrid. I require to keep the old content running. Because this is just an upgrade of the backend. But plan to start developing in MVC for all new components etc. I will phase out the old web forms as content pages change. This requirement is pushed on me by the business.
The old site used Glass Mapper to generate and map content from sitecore. Using the old Glass.Mapper.Sc.CasteWindsor v3.2.1.21 via t4 scripts in TDS.
I looked over the Glass homepage. Where is states that Glass.Mapper.Sc is all that you require now. But there are conflicting tutorials out there stating you need to install the MVC-4 or MVC-5. I figured I would ignore them for now and stick to the Glass suggested install.
Trouble is that the old Model properties are tagged with attributes like
[SitecoreId] & [SitecoreInfo(SitecoreInfoType.Language)]
Which don't seem to be in the Glass.Mapper.Sc library. The only reference I can find of these attributes in the available nugets packages. Is the Glass.Mapper.Sc.Core package.
I tried to install that package in the models project. Just to see this :
Start package installation to project [project].Logic.Models
Installation failed. Rolling back...
Error: Unable to resolve dependencies. 'Glass.Mapper.Sc.Core 4.2.1.189' is not > compatible with 'Glass.Mapper.Sc 4.3.1.194 constraint: Glass.Mapper.Sc.Core (≥ > 4.3.1.194)'.
Installation finished.
I feel like I might be making a mistake if I down-grade the Glass.Mapper.Sc so I can install the Core library. I might be shooting myself in the foot later on. Because I still have to install WFFM and Social Connection Module being replace with the internal sc8 social components..
My understanding was that the new Glass.Mapper.Sc package should cover all my needs.
So should I down grade and try and use the older version with the Core libraries?
Or should I refactor the models to use a new attribute system. What ever that may be?
(Keep in mind there are around 50+ models in the project. So it's not something that I would like to have to do .. )

Glass Mapper was significantly changed in version 4 and the biggest change was the removal and reliance on Castle Windsor. A list of the changes were listed in the release blog post.
The Nuget package/installer has also been changed so there is now only a single Nuget package instead of the several which you previously had to install. To support this, the Nuget installer checks for the presence of Sitecore.Kernel.dll and System.Web.Mvc:
To make things simpler V4 uses a Powershell script to decided which references to add to your project, it checks both the Sitecore.Kernel version and the System.Web.Mvc version and then installs the appropriate Glass.Mapper.Sc and Glass.Mapper.Sc.Mvc assembly.
My suggestion would be to remove the old V3 assemblies and Nuget references, make sure the above 2 DLLs are correctly referenced in your project(s) and then install Glass V4 Nuget to those projects again.
The SitecoreId and SitecoreInfo attributes are still in the Glass.Mapper.Sc library, the Core library has been removed/refactored. I don't believe this namespace has changed since V3 but make sure you are using the GlassV3Header.tt file and the using Glass.Mapper.Sc.Configuration.Attributes namespace is correct in that file.
https://github.com/HedgehogDevelopment/tds-codegen/blob/master/Sitecore.Master/Code%20Generation%20Templates/GlassV3Header.tt#L32

Related

Microsoft ML can't use opset 11 despite nuget package installed

I'm trying to build a simple object detection runner, really just following this MS Docs guide: https://learn.microsoft.com/en-us/windows/ai/windows-ml/tutorials/tensorflow-deploy-model
I already figured out building the View and adding capabilities so the provided code actually compiles.
Just one more problem right now: When creating the session, it crashes claiming "Unknown model file format version" which seems to translate to "Opset of the model you use is not supported".
Looking at github issues google showed me, I'm supposed to install the Microsoft.AI.MachineLearning nuget package and all is well. Except when I installed it, nothing changed.
So, what's left to do beside open yet another github issue? I already re-exported my model from opset 15 to opset 11 because the nuget package only supports that.
I'm on windows 10, UWP targeting 2004.

microsoft visual studio installer projects issue

I made a laucher application in c++ that use direct 2d and 3d. Now i making a installer for this. I followed microsoft docs and i made it but there is a issue.
I use 'Microsoft Visual Studio Installer Projects' extension to make that.
The issue is if i already installed my launcher with a previous installer msi file, if i rebuilt a new installer msi and try to run it it show me this error
This is the microft docs i followed to make this: https://learn.microsoft.com/en-us/cpp/ide/walkthrough-deploying-your-program-cpp?view=msvc-160
In the future maybe i need make a update for my laucher. It isn't good idea everytime need go to control panel, search and delete the previous application and install the new one manually.
Anyone know how can i make it automatic remove old version and install new one? Maybe there is a better way to create a installer?
Major Upgrade: In order to upgrade properly, you need to use a major upgrade so that your new version uninstalls the old one and then installs itself (this can happen in reverse order too: new version installed and old remnants deleted afterwards, but this is another story). There are further upgrade types, but stick to major upgrades for simplicity.
The message you are receiving is basically because you have a different package code for the new MSI, but not a new product code or version number (or just one of those problems). You need to get the settings straight.
Recommended step-by-step:
Set "RemovePreviousVersions" to True in the project properties.
In the same place: bump up your version number (one of the first 3 digits)
Answer yes when asked to change product code, or do so yourself manually.
Keep the UpgradeCode the same - it needs to be stable across releases.
Rebuild your setups. Clean out your box of old remnants before testing or test on a virtual.
Testing: Remember to simulate your full upgrade process from first version installed to the new one with different version numbers for a few core files and also try to add a few files and such things. Very important to verify.
Heads-Up: Before ending, it is standard procedure to warn about the potential limitations of VSInstaller Projects (shorter list form).
MSI Tools: Here is a short "review" of other MSI tools.
MSI Upgrade Types: Shamelessly stolen from the InstallShield help file (towards bottom):

.NET Core React Project Doesn't See NPM modules

I'm trying a React/Redux .NET core (2.0) web project in Visual Studio 2017. And I've installed font-awesome using npm. It's there and I can see it in the node_modules folder, but I'm not sure if the web project should see it automatically or if I have to drag it into my dist folder and edit my layout page to see it. I'm not against doing that, but as a VS programmer, I'm used to things being a bit more automatic mainly for the sake of package updates. I'm not really confortable editting the vendor.js or vendor-manifest.json files.
Anyone know what I'm doing wrong? (no guesses, please.)
I was looking for an answer to a similar question and came across FA's package specifically for React. They have some good instructions on this page.

What is the best way to install VC++ redistributables via a group policy?

This ought to be simple, but seems to be anything but.
I wish to create an installer that can be used by those using group policies to install products. I do not know then if this must be an MSI, or an EXE. Can an EXE install be installed via a group policy? I chatted with another Wix novice who seemed to think it was a bad idea to have an install that was a plain MSI file.
My product uses the Visual C++ 2010 redistributables. I do not wish to use merge modules. Both this and this link give some of the disadvantages of using them. I object to 1) installing things that the user has not consented to, and 2) not having a control panel uninstall item with a version number that users can inspect and see if they have the latest version of. Thus, I am not interested in responses consisting of people lecturing me on why I ought to use merge modules. If what I am asking for is truly IMPOSSIBLE without merge modules, then please explain why.
I do not know if it is necessary to use a bootstrapper to kick off an EXE install. I gather that it is, but it seems bizarre for me, for an MSI with such involved tables and descriptions, not to be able to kick of a mere EXE, ON THE CONDITION that the redistributable is not installed already.
If it is necessary to use a bootstrapper, I would like to know if anyone can find a complete example, with both bootstrapper and Wix code, for an example of a product install; ideally, together with the command lines necessary to compile them, for such a common case as installing a VC++ 2010 (or possibly 2012) program, together with its redistributable - with the latter being installed as the EXE.
I have found this to be straight-forward and easy to do in Inno Setup Pascal - except for the Group Policy part. I have found anything but COMPLETE examples and/or straightforward explanations to accomplish this using a Microsoft installer. No matter what Microsoft says, I would consider such an installer to be best practices. My code is not managed, and I would like to support XP. Thus, a bootstrapper that requires some .net to already be installed would only add another unsolved layer of complexity to the problem. One that statically links to a .net library might not be too bad, if it did not create very much overhead. My MSI install seems to work pretty well. I did not realize that installing a vcredist_x86.exe would be a problem with such an elusive solution. I do not have Visual Studio. I am using the Qt framework, and have Visual Studio installed only to compile my application. If you have a bootstrapper solution, please specify which bootstrapper you are using. Ideally, the same idea could be extended to more than one prerequisite, and the same coding pattern could be used. If there were a way to use a merge module or additional MSI so that the redistributable would have its own control panel entry, that could be acceptable.
Brownie points for suggesting a mailing list, forum or well-populated chat channel to talk about Wix that does not require one to receive a lot of unnecessary mailing list traffic.
Group Policies by default don't allow EXEs to be installed. I did read about some admins that repackage EXEs into MSIs to deploy them via GPO but that is rather hacky. There is also the possibility to script the deployment - GPOs support script execution, machine or user level.
You can't embed an MSI within another MSI either because only one installation can execute at any time (Windows Installer design).
I don't know how you will be providing your product to your customers but vcredist_x86.exe (I am trying this with the v100 version) uncompresses into the root folder and generates an msi and a cab (vc_red.msi and vc_red.cab) among other files. If you provide these to your customers they can add them to the same GPO used to deploy your product.

Template requires newer script versions than project contains

I try to use the breeze/angular template for MVC 4. However, during start up I get this:
Package installation error
Could not add all required packages to the project. the following packages failed to install from .../asp.net mvc 4\packages
jquery.ui.combined.1.9.2 unable to find version 1.9.2 of package.
Now I see that the folder contains jQuery.UI.Combined.1.8.24, so I was wondering:
Is there a way to edit the project so that it (maybe always) uses the latest versions of the packages by default?
Should I just press OK and afterwards install jquery.ui through nuget afterwards?
Is there a clever way to fix this?
I know there has to be a solution due to the uglyness of getting an error by default when using a custom template. I've been googling my ass off without any results :(
Hope to update the templates soon and get MS to republish. You can't update the template easily yourself.
Fortunately, this particular issue is easy to workaround by adjusting your code to use latest jQuery or rollback to 1.8.x.
I can't use the latest verison of jQuery so I manually updated the jQuery files to 1.9. Also, check your nuget manager for updates. Breeze released 1.3.6 which will update the appropriate dependent project libraries (my jQuery files were untouched).
As of Visual Studio 2012 Update 3, the Breeze/Angular SPA template is totally broken. The jQuery update fix worked with VS2012 Update 2, but some change or another in Update 3 has made VS not play nice with the sample.
It isn't ideal, but given that Update 4 is just around the corner, we might need to hold our breaths in anticipation of a post-Update 4 fix. :(