Everything is installed and everything is ready, but this problem occurs during compilation:
Error 296 The type or namespace name 'combit' could not be found. (Missing a using directive or assembly reference?)
Yes, we were able to solve it after a long time.
Our Project Version
Our project runs on .net 4.5.2.
Plugin Version
The latest version of Combit.Reporting is .net version 4.7.
In other words, it will not give any error, but it will prevent your project from compiling because the .net versions do not match.
Attention!
If you want to connect a project that needs a higher .net version to
your project, consider the above article.
Related
I had a Microsoft WebForms report viewer library version 10 referenced in my project, and I decided to remove that reference and add the version 150 NuGet package. However now I get a bunch of compile errors like so:
Error CS0246 The type or namespace name 'LocalReport' could not be found (are you missing a using directive or an assembly reference?)
and other similar errors. The weird thing is, when I open up the files containing the errors, the errors go away, but as soon as I try to build my project, they reappear! What's going on here? How can I compile my project without errors?
The problem was that the report viewer library I added the reference to required .NET Framework version 4.6, but my projects were only using version 4.51. Upgrading to v4.7 solved the problem.
I have a .NET 4.0 C# project where I need to run Powershell via C# in powershell runspace. I had tested my code it was all working good.
When opening same project on a new computer (Win10, VS2017) and trying to run same project getting issues.
I have referenced the DLL on:
C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll
Also doing this using commands
using System.Management;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
but System.Management.Automation and System.Management.Automation.Runspaces are not recognized.
Getting the error: The type or namespace name 'Automation' does not exist in the namespace 'System.Management' (are you missing an assembly reference?)
Somehow the references are not being used...
Not sure what exactly happens but when I was referencing the following DLL:
C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll
VS was ignoring this DLL and complaining that we're missing the Automation namespace... although this DLL was showing as .NET 4.0, apparently it was compiled with a higher version of .NET which may explain why it was ignored.
To resolve the issue I had to add a reference by browsing and picking this DLL:
C:\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll
which may seem like an older version of the powershell engine.
One more note which may have contributed to this is that on my new Win10 machine, I installed VS2017 so I did not manually install the .NET 4.0 FW and maybe the VS2017 installation puts higher version of the System.Management.Automation DLLs...
The screen shot below shows that VS 2012 intellisense picks up Helpers namespace from SendGrid namespace, but there is still a compile time error stating
The type or namespace name 'Helpers' does not exist in the namespace 'SendGrid'
(are you missing an assembly reference?)
What I checked:
The project is .NET 4.5 and that never changed.
SendGrid and SendGrid.CSharp.HTTP.Client references both have
v4.0.30319 runtime version, same as the rest of references.
Newtonsoft.JSON used by SendGrid is also the same runtime version.
Both are set to copy local True.
There are no other errors in the project.
F12 following a method from SendGrid.Helpers namespace navigates to its definition successfully, so I surmise there is no issue with the referenced DLL???
Cleaned and rebuilt the solution, restarted VS and machine.
Switched .NET version of the project between 3.5 and 4.5 several times back and forth.
SendGrid was added using Nuget to an existing project.
Installing an older version SendGrid-4.0 as per Hans solved the issue.
Lots of times this is caused by a build break during a design-time build, see https://github.com/dotnet/roslyn-project-system/blob/master/docs/design-time-builds.md#diagnosing-design-time-builds for instructions on diagnosing these.
I am fairly new to C# language so I just do not understand why my build produces error messages like the following.
The type or namespace name 'ProtoBuf' could not be found(are you missing a using directive or an assembly reference?)
What's interesting is that I don't get an error if I target '.NET framework 3.5' but I am getting an error once I set the project to target to '.NET framework 2.0'
Code stays the same and protobuf-net should be working with .NET 2.0 so I am not sure what I am missing.
FYI, the line that causes the error above is this line:
using ProtoBuf;
Can anyone give me some suggestion to resolve the error above? Thank you in advance.
You need to add a reference to the protobuf-net for .NET 2.0 assembly when you're targeting .NET 2.0, and a reference to the protobuf-net for .NET 3.0 assembly when you're targeting .NET 3.0/3.5.
The standard download zip contains several dlls with cumulative features; in particular, the 3.0 version includes WCF hooks that only exist in 3.0 and above. While VS2008 is fairly forgiving here, VS2010 will usually point-blank refuse to include a reference for a higher framework.
If you don't need WCF, then the 2.0 version should work on any of 2.0, 3.0, 3.5 or 4.0 Otherwise - pick the right dll from the zip.
I'm using Visual Studio 2010 Express for C# and am having trouble installing the code pack.
I downloaded the source from MSDN and don't know what to do with it?
I opened the WindowsAPICodePack.sln and attempted to build the project and got:
Error 16 The type or namespace name 'ContentPropertyAttribute' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Joe\Downloads\WindowsAPICodePack\Shell\CommonFileDialogs\CommonFileDialogRadioButtonList.cs 13 6 Shell
and
Error 13 The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'. This type has been forwarded to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly. C:\Users\Joe\Downloads\WindowsAPICodePack\Shell\obj\Debug\Controls\CommandLinkWPF.g.cs 42 99 Shell
each about 5-6 times each.
I attempted to build the samples also but got similar errors.
How do I install the code into Visual Studio?
How do I fix the errors?
How do I include the code into my projects?
Can I make the Library usable in my projects with just a "using" command?
Add a reference to System.Xaml.dll to your project.
I've just downloaded version 1.0.1, opened it up in Visual Studio 2010 Professional and built it with no problems at all.
Check which version of .NET your projects are now targeting. It's possible that the Express edition automatically "upgrades" projects to target .NET 4, whereas mine have been left targeting .NET 3.5.
Another thing to check - do you have .NET 3.5 installed? I'd expect so, but it's worth checking.
When you've built the projects, you need to do two things to use them:
Add a reference to the built assembly (e.g. Microsoft.WindowsAPICodePack.dll)
Add a using directive to the appropriate namespace. (This is actually optional, but otherwise you'll have to use the fully-qualified name for any type in the library, which isn't generally what you want.)