开发者

The type or namespace 'dotliquid' cannot be found, but I have added the reference

开发者 https://www.devze.com 2023-03-20 05:09 出处:网络
So I have vs.net 2开发者_如何学运维010. I downloaded the DotLiquid.dll from: https://github.com/formosatek/dotliquid

So I have vs.net 2开发者_如何学运维010.

I downloaded the DotLiquid.dll from: https://github.com/formosatek/dotliquid

I created a simple method to test it:

public static void DL()
{
  var template = Template.Parse("hi {{name}}"); // Parses and compiles the template

  Console.WriteLine("Template is : " + template.Render());
}

I have:

using DotLiquid;

at the top of the file.

No idea why I am getting this error, very confused!


Also check that you have the version that is tergetted to the same .Net framework version as what you are using.

This means if you are using the framework v4.0 Client Profile, you may have to retarget to the full version. If you are already using the fll version and DotLiquid is using the Client Profile, that is fine.

If you are targetting v4, and DotLiquid is using 3.5, you will have to retarget your project to 3.5, or recompile DotLiquid to v4.

Did that make sense?


Did you add the reference (dll) to your project? Right click the References folder in your solution explorer and add it that way.


Here's my checklist of things to do:

  1. Create a new blank C# project, add a reference to this assembly.
  2. Please make sure that no issues are seen under References, like shown in the example here:

The type or namespace 'dotliquid' cannot be found, but I have added the reference

  1. Build the application. Make sure no errors are seen.
  2. Add a using statement and the method as you've posted in your original message.
  3. Build again, see if buuild is OK or not.

I could easily build the code you posted with no errors.

0

精彩评论

暂无评论...
验证码 换一张
取 消