Skip to main content

Posts

Could not load file or assembly 'Microsoft.Web.Infrastructure'

Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.



What 'Micorosoft.Web.Infrastructure' does? This dll lets HTTP modules register at run time.
Solution to above problem: Copy 'Micorosoft.Web.Infrastructure' dll in bin folder of your project and this problem should be resolved. If you have .Net framework installed on machine, this dll should be present on it. You can search for this dll and copy it in your active project folder.  
Alternatively,  you can install this dll using nuget package manager PM> Install-Package Microsoft.Web.Infrastructure -Version 1.0.0
Happy coding!!
Recent posts

WFFM: Save to Database

Web Forms For Marketers has become one of the essential component of Sitecore. Almost every website is using forms to capture the inputs from users and it is very common scenario to get the data stored in Database for reporting purpose. Here are few easy steps which can help you storing the form's data in SQL database.


Download the WFFM - SQL Provider(Save To Database) and install it in Sitecore using Installation wizard. All physical files and Sitecore items will be stored in respective location.Once installed, you will notice that it has created a new Action under System-> Modules -> Web Forms for Marketers -> Settings -> Actions -> Save ActionsNow, we have to add connection string in configuration file which will help us storing the data in that database. You have to keep the name of connectionstring to 'wfm' only as same name is referred in WFFM module code.
< add connectionstring="user id=your_db_user_id;password=your_db_password;Data Source=you…

HTTP Compression and Performance tuning

With the advancement of technology and exceeding expectations of users, one has to be very careful designing a website. Performance is one of the key elements for success of an application. Even if, you have designed the application with uttermost care and rock solid architecture, there are few key areas in which you have to be really vigilant. HTTP Compression is one of those pivotal spaces.

HTTP compression is the technique to compress static and dynamic content which improves the transfer speed and performance of a website.

Steps to keep the compression ON for a website. Here the demonstration is given for IIS based website.
1. Open IIS (inetmgr)
2. Goto website. Right side will show all components of that website
3. Click on 'Compression' module and verify that both the checkboxes are checked if you need static and dynamic content to be compressed.




4. Click 'Mime Types' and check 'application/x-javascript' is added in the existing mime types. If not, add it.

Running dotnet on Linux

Server: Linux, version SUSE 12

To run dotnet code on Linux, the first and foremost task is to "Install Mono package on linux".

Note: Mono is an open implementation of Microsoft's .Net framework, including compilers. It uses the same development libraries on Linux which are being used on Windows. Therefore, if you code and compiled some mono code on Linux,  it will work for Windows as well.

      zypper is a package installation tool which is used in this scenario. If zypper is not available, check which package manager tool is installed on server. Furthermore, to verify if zypper is installed or not, type zypper on command line which will show all options if zypper is available on server else it will show 'command not found'.

zypper ar -r http://download.opensuse.org/repositories/Mono/SLE_11_SP2/Mono.repo
The above command will download from mentioned URL in a new repository. Here 'ar' stands for 'add repo'.

After adding it to repository, type '…

Cannot alter the login 'sa', because it does not exist or you do not have permission.

Working on projects, it can happen that 'sa' account gets locked. If it is on local machine OR development boxes, onus would be on you to fix it. If scripts and SQL steps are not working, this might help you fixing the issue.

Steps to unlock 'sa' account and resetting the password.

1. Open SQL Server Configuration Manager

2. Select SQL Server Services -> 'SQL Server' service.
3. Right click on 'SQL Server' service and click on "Startup Parameters". For 2008, server "Startup Parameters" are inside Advanced tab.


4. Add '-m' in startup parameters as shown above and click on 'Add'. This will put SQL server into 'Single User Mode' and local admin will have 'Super User' rights. For 2008, server you have to add ':-m' in the last of the existing query.
5. Save the settings and Restart the service.
6. Now open the SQL Server Management Studio and connect to database using 'Windows Authentication&…

Setting up web server and continuous integration

Apart from creating website & app-pool in IIS, there are several steps which need to be performed when setting a new website on server.

Setup Web Server

There are few activities which you have to perform on Web Server:
1. Install Web Deploy [Download]
2. Install URL Rewrite [Download]
3. Make Sure .Net Framework feature is ON in Windows features


4. Create a standard user which could be used to deploy files to web server after successful build
5. Open "services.msc" and check that 'Web Deployment Agent Service' is running with the standard user credentials created in Step 4.


6. Run App pool and website with same standard user which is created in Step 4
7. Reset IIS Server


Continuous Integration

There are several tools which are being used for continuous integration but they perform same functions when we discuss about build and deployment. In this example, we are referring Jenkins [Download].



If msdeploy or any relevant command is being used to deploy files on web …

Get all Items inheriting another template

Working on different templates and Sitecore items, its very common requirement to know

how many items are created with a specific templatehow many template are inheriting a base template or another template
Sitecore provide this feature out of box however you need to write query to fetch the required items.

Open Sitecore IDE (http://localhost/sitecore/shell/default.aspx?xmlcontrol=IDE)Goto Tools -> XPath BuilderWrite XPath Expression:
/sitecore/templates//*[contains(@__Base template,'{1FE1328B-375B-4548-A53E-344FA61ACC90}')]



In result section, it should show all templates which are inheriting base template with ID {1FE1328B-375B-4548-A53E-344FA61ACC90}.

Similarly, query  /sitecore/content//*[@@templatename='Promotional Page'] should show all pages (under content) created with 'Promotional Page' template.
On top of results, it shows the count of items and time taken to fetch the items.
We can use fast query as well instead of query.
Note: The above queries are …