I get an error when using razor helpers in an MVC 3 project (did put the cshtml file in app_code). Looks like the generated code is using a wrong assembly reference.
using WebMatrix.Data;
using WebMatrix.WebData;
Compiler says:
CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)
Putting them into GAC did not change anything. Am I not getting it? Or is this a bug? Any ideas?
You need to add a reference to the DLL in Web.config.
mbr, we are aware of the issue and plan on addressing it for RTM. You could either add references to the WebMatrix assemblies like SLaks suggested or (and I think this is better) simply add those 2 namespaces to your project by adding the following code:
namespace WebMatrix.Data { internal class Ignore { } }
namespace WebMatrix.WebData { internal class Ignore { } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With