How can we override/rewrite Enterprise class files/class (for Enterprise Edition of Magento)?
I got it. It's similar to what we do with core files in Community Edition.
Just need to see the config.xml of any Enterprise core modules. They put "enterprise" in front.
Sample code to override Enterprise_GiftRegistry Block:-
<blocks>
<enterprise_giftregistry>
<rewrite>
<customer_list>MyNamespace_MyModule_Block_MyBlock</customer_list>
</rewrite>
</enterprise_giftregistry>
</blocks>
Thanks.
Related
In the days of app.config/web.config, it was possible to use Xml Configuration within the config file to configure the Unity Framework. Is there still some way to do that moving forward into the .Net Core 3.1 & 5.0 world? If so, might someone provide a good example and documentation on it?
Yes this is still possible, Create an app.config that specifies the where your unity container config file is:
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"/>
</configSections>
<unity configSource="unity.config" />
They are working on supporting json and .net core directly, but that’s for the future.
I have had to take a very old project out of it's dusty box and upgrade it from 4 to 5 and I followed the guidance on the MS Site (https://learn.microsoft.com/en-us/aspnet/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2) and it all works perfect locally on my dev machine. Yep it works on my machine so ship it right....
Well No because I publish to the server and this is where the issues start as I keep getting errors saying:
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The 'targetFramework' attribute in the
element of the Web.config file is used only to target
version 4.0 and later of the .NET Framework (for example,
''). The 'targetFramework'
attribute currently references a version that is later than the
installed version of the .NET Framework. Specify a valid target
version of the .NET Framework, or install the required version of the
.NET Framework.
I have checked that the Web.Config file has the Target set to 4.7.1 and on the server the current version is 4.7.2 so where am I going wrong.
The line in the Web.Config that is being referenced is:
<compilation debug="true" targetFramework="4.7.1" />
And at the bottom of the error page:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2106.0
I like my local machine too much to ship it to the cloud so someone please help. I have been bashing my head against the desk for hours now and Google/Bing etc are not helpful.
Have you tried to install "Runtime" SDK on the server?
The runtime SDK for Framework 4.7.1 can be found here:
https://www.microsoft.com/net/download/visual-studio-sdks
If you haven't done it, try it!
Probably you don't have the .Net version in the hosting server just install the .Net version in the server.
.Net 4.7.1 Offline Installer
Thanks for the responses but this site is hosted on a shared hosting platform so I can't install anything, but I checked and they have 4.7.2 installed.
I fixed the problem by removing the targetFramework from the compilation settings and worked a treat.
Old:
<compilation debug="true" targetFramework="4.7.1" />
New:
<compilation debug="true" />
Thanks for the help. Now onto the next issue.
I created a class library in .net core and and hosted class library on my local nuget server.Class library contains controllers and some other classes to be used by reflection.
I consumed this class library in my asp.net core MVC project.By installing it as nuget refrence. Now my MVC project builds well but at runtime I am not able to find my contoller or other classes defined in class library.
weird behavior when I copy dll of my class library to my MVC projects bin\Debug\netcoreapp1.1 directory, reflection starts working.
this is happening when i run my application in debug mode on IIS Express and I am using .net core 1.1 on Visual studio 2015
Question: Is there a way to extract nuget packages in to bin\Debug\netcoreapp1.1 on build.
Question: Do I need to added some configuration so that Reflection look for dll in respective nuget package location.
Have a look at this answer, it might cover what you are looking for.
https://stackoverflow.com/a/38252635/138029
UPDATE:
You could try adding a NuGet.config file to your project root.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Local" value="[PATH_TO_YOUR_NUGET_PACKAGES]" />
</packageSources>
</configuration>
As an aside, if the directory is local to the project root you can commit those local packages to the Source Control. This allows build tools like Visual Studio Team Services to reference them automatically when they build.
Probably a noob question but what version of .NET is used in a ASPX web application? Is it the version defined in the project propperties or the one defined in the web.config file of the website?
I need to know this because an API I am using in the web application is closing all non TLS1.2 protocolls. And as far as I understand TLS1.2 is the default in .NET 4.5. The server is Windows Server 2008.
Visual Studio uses web.config values to initialize the property pages. So, they're one in the same.
You see the .NET version from the property pages in the web.config similar to this:
<configuration>
<system.web>
<compilation targetFramework="4.5" />
</system.web>
</configuration>
If you change the target framework in the project properties and save, you should see the updated target framework in that value in your web.config file.
I need to understand how to make an ASP.NET web application FIPS compliant. To keep it simple, I created a new web application within VS 2008. I have FIPS enabled on my development machine, as the client using the web application will be a Federal agency that will enforce FIPS.
I can not even compile the new web application - as it gives me the error:
This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
I have read documentation and added the following elements to the web.config file:
<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/>
<enforceFIPSPolicy enabled="false" /> (also tried <enforceFIPSPolicy enabled="0" />)
But I still get this error. Again, I want to get this to work with a brand new web application before I attempt to get it to work with my actual solution.
I am using .NET 3.5 SP1 for the framework.
Any help would be greatly appreciated.
Thanks.
Chris
if a reference to ANY non-FIPS compliant algorithm is in the code, even if never actually used/reachable will cause the FIPS compliance error. For example just declaring an MD5CryptoServiceProvider variable without even instantiating it will cause the error. This includes other referenced .NET assemblies, so be sure no referenced dlls are possibly using non-fips compliant algorithms as well.
Here's a handy site that lists all of the FIPS and non-FIPS algorithms in .NET http://blog.aggregatedintelligence.com/2007/10/fips-validated-cryptographic-algorithms.html
There are two things to make a new.NET application FIPs compliant.
1) In your machine key settings, use 3DES for decryption and SHA1 for validation, as you mentioned in the question. (There is a STIG out that says you should use SHA1. https://www.stigviewer.com/stig/iis_7.0_web_site/2014-03-25/finding/V-26026)
2) Ensure that the code is not in debug mode.
The compilation section of your web.config and the page directives should all have debug="false". Debug="true" will kick off the FIPs compliance error before .Net can even run the first line of code.
For visual studio to compile the code, you may need to disable fips on visual studio.
For visual studion 2010:
Open Devenv.exe.config from
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE if you are on x64 OS
or C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ on x86 OS
Find </runtime> tag and add the following above that line:
<enforceFIPSPolicy enabled="false"/>
After the above modification devenv config would look like:
<configuration>
<runtime>
.
.
.
<enforceFIPSPolicy enabled="false"/>
</runtime>
</configuration>
Restart Visual Studio
https://blogs.msdn.microsoft.com/brijs/2010/08/10/issue-getting-this-implementation-is-not-part-of-the-windows-platform-fips-validated-cryptographic-algorithms-exception-while-building-outlook-vsto-add-in-in-vs-2010/
Sources: https://msdn.microsoft.com/en-us/library/w8h3skw9(v=vs.100).aspx
https://blogs.msdn.microsoft.com/webtopics/2009/07/20/parser-error-message-this-implementation-is-not-part-of-the-windows-platform-fips-validated-cryptographic-algorithms-when-net-page-has-debugtrue/
http://forums.asp.net/t/1778719.aspx?+FIPS+validated+cryptographic+algorithms+3DES+machinekey+solution+didnt+work