I simply want to install Unicode.NET library, what do i do wrong?
(I'm using VS Community 2017, V:15.3.4)
This library is an emoji and text-processing library for .NET. They are using Assert from xUnit library. Take a look at their source code from github. inside the tests folder.
Read more here
You need to install the NUnit-test framework as well. The red underlined code is a hint that the compiler cannot resolve the assert-function used in your code, which is part of the NUnit-framework.
Just look for enter link description here
So get the package, add the reference to your project and don't forget the using directive:
using NUnit.Framework;
Related
Intro.
I installed System.Reactive into my c# project and be using it's methods in the project.
So, I want to read source code of System.Reactive on VisualStudio.
Question.
How to be able to read the source code on VisualStudio?
Important notices
I found source code on GitHub but it's too unless to read for me.
I want to read source code body, but not signiture.
I want to search definition of method used in my project by using F12-Key.
Based on comments, I decided to adopt the following method.
Clone ReactiveX project from GitHub
Build the project my self.
Add reference of the dll and the project into my project.
By the way, as for the server, I could not find out about it, so I decided not to use it.
I have found many examples of code for JSON.NET, but I am unable to make any of them run in Visual Studio (C#). Quite probably this is because I am missing something obvious in how to code.
Particularly frustrating is the example code in newtonsoft.com will not compile and run. For example http://www.newtonsoft.com/json/help/html/SerializeObject.htm contains code for 'Types' and 'Usage' but there are no using statements and I can't figure out how to put the code into a project in a way to make it work.
I am sure I am missing something basic I just can't figure it out. I have been Googling for an answer for three days. Can you help me?
Assuming that you have downloaded the Json.NET nuget package (or otherwise properly added Newtonsoft's package to your project and referenced it) the only using statement you need other than the standard ones visual studio adds for you is Newtonsoft.Json
Their code runs perfectly fine in a project of type console application with the following using's:
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
The only other thing you might want to do is add a Console.ReadLine(); at the end so that you can see the output.
As I attempted to reply to your questions I created a new C# Console Application Solution named CA_Json.
I right clicked on the project named ‘CA_Json’ and selected ‘Manage NuGet packages…’.
I then selected ‘Newtonsoft.JSON’ and clicked the ‘Install’ button.
Then this page appeared http://www.newtonsoft.com/json/install?version=8.0.2 and Newtonsoft.JSON appeared under References
So I believe I have added JSON successfully.
In Program.cs I added this:
• using Newtonsoft.Json;
• the code for Types
• and the code for Usage
I compiled it and then started debugging and it worked! I went back and checked my prior project and somehow the Newtonsoft.JSON Did NOT appear under References, even though I had added it earlier.
Thanks so much! Your questions forced me to carefully review my work and discover my error. :-)
I started off from the thread to [decode data matrix in C#] (How To Use ZXing C# Port)! but I am encountering an error that prevents me from using zxing.
error states: "The type or namespace name 'com' could not be found (are you missing a using directive or an assembly reference?)"
In my code i am (trying to) use:
using com.google.zxing;
Please let me know what I am doing wrong.
It'd be nice if C# could automatically detect the references you're using and download them, but this is not the case. You need to download the ZXing SDK and reference it before using it.
The easiest way to do so is via NuGet, which is built in Visual Studio from 2012 onwards, and available for VS 2010. Right-click on your project, click on "Manage NuGet Packages", then select "Online" from the left-hand menu and search with the search box in the top right.
There are two ZXing ports available on NuGet, so you'll have to look at them both and pick the one that seems right for you.
You can also find some ZXing DLL on the Internet and reference it from your project: right-click on your project's "References", click on "Add reference..." then on the "Browse" button.
However, that is not as convenient as NuGet because you need to manually check for updates to the library, and update the DLL, whereas NuGet will tell you when an update is available (it won't force you to update).
Just by looking at your code sample, I wouldn't suggest using a port that uses Java-like namespaces (a more C#-y version would be e.g. "Google.ZXing"), since it sounds like a "dumb" port that simply converted the Java syntax to C# without thinking about whether some C# features are better at doing whatever the original library wanted to do.
I've used ZXing.Net v0.14 in a Windows Phone app and it works well.
You have to replace
using com.google.zxing;
with
using ZXing;
if you are referencing and using the ZXing.Net assemblies.
I replaced the Java-stylish namespaces with a more .Net like version.
Old sample around the web doesn't work with ZXing.Net.
In the source code repository and the download section of ZXing.Net you will
find some more up-to-date samples. You should really start with the newer samples because I wrote some simplifications on top of the port.
Attempting to create the example in the walkthrough: http://msdn.microsoft.com/en-us/library/dn632175(v=vs.103).aspx I am using VS2013.
In the section 'Defining the LocalizedExportCodeAnalysisRuleAttribute Class' I am getting the following error:
The type or namespace CodeAnalysis does not exist in the namespace 'Microsoft.SqlServer.Dac
It appears that the Microsoft.SqlServer.Dac library is part of the SQL Server SDK and not necessarily "default" library that comes with Visual Studio.
You can download the SDK through the SQL Server Data Tools library here. After installing, it should have the libraries you need. You'll then want to make sure you add a reference to the library in your project before continuing.
the code analysis namespace is under Microsoft.SqlServer.Dac.Extensions and not Microsoft.SqlServer.Dac
So I have vs.net 2010.
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:
Create a new blank C# project, add a reference to this assembly.
Please make sure that no issues are seen under References, like shown in the example here:
Build the application. Make sure no errors are seen.
Add a using statement and the method as you've posted in your original message.
Build again, see if buuild is OK or not.
I could easily build the code you posted with no errors.