Error when deploying to Azure

Dec 24, 2011 at 1:14 AM

I am currently getting the following error.  Everything compiles and runs fine locally, but when deployed to Azure it says it cannot find Moq.  I've deleted and re-added the reference, validated that it is in the bin folder, etc.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Error compiling module "Contrib.RewriteRules" from file "/Modules/Contrib.RewriteRules/Contrib.RewriteRules.csproj":
The assembly reference 'Moq' could not be loaded.

There are generally a few ways to solve this issue:
1. Remove the assembly reference from the project file if it's not needed.
2. Ensure the assembly reference is present in the 'bin' directory of the module.
3. Ensure the assembly reference is present in the 'bin' directory of the application.
4. Specify the strong name of the assembly (name, version, culture, publickey) if the assembly is present in the GAC.

Source Error:

Line 1:  <?xml version="1.0" encoding="utf-8"?>
Line 2:  <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Line 3:    <PropertyGroup>


Source File: /Modules/Contrib.RewriteRules/Contrib.RewriteRules.csproj Line: 1


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

Dec 24, 2011 at 1:39 AM

After dropping/re-adding the reference the error message changes slightly to show the public key:

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Error compiling module "Contrib.RewriteRules" from file "/Modules/Contrib.RewriteRules/Contrib.RewriteRules.csproj":
The assembly reference 'Moq, Version=4.0.812.4, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL' could not be loaded.

There are generally a few ways to solve this issue:
1. Remove the assembly reference from the project file if it's not needed.
2. Ensure the assembly reference is present in the 'bin' directory of the module.
3. Ensure the assembly reference is present in the 'bin' directory of the application.
4. Specify the strong name of the assembly (name, version, culture, publickey) if the assembly is present in the GAC.

Source Error:

Line 1:  <?xml version="1.0" encoding="utf-8"?>
Line 2:  <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Line 3:    <PropertyGroup>


Source File: /Modules/Contrib.RewriteRules/Contrib.RewriteRules.csproj Line: 1


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

Jan 3, 2012 at 6:02 PM

Download the source code from here: http://code.google.com/p/moq/downloads/detail?name=Moq.4.0.812.4-src.zip&can=4&q=

just compile it and add the moq.dll to the bin folder in the module and in the web bin folder.

I hope this works for you

Alberto