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.
Related
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.
What I am trying to do:
Upon building my solution for the first time, I see errors related to missing namespaces. They have a code of
CS0234: The type or namespace name 'Http' does not exist in the
namespace 'System.Web' (are you missing an assembly reference?)
What I have tried so far and didn't work for me:
System.Web.Http missing after .net 4.5 upgrade
System.Net.Http: missing from namespace? (using .net 4.5)
Can't add a reference to my project - it simply doesn't detect it
What I am trying to do from my own end but doesn't seem to work:
On Nuget's official website I am trying to install this package using Package manager command:
PM> Install-Package System.Web.Http -Version 4.0.0
But, I see the following error on the console
What I want from you:
At this point, the only way to resolve this issue is by reaching out to one of my other team members and ask them to send me the missing .dll.But I would encourage an answer that would help me get through this issue by pointing to the root cause of this problem and if there is an alternate way to get this missing reference.
Useful note:
I am building this solution on Visual Studio 2019 and the solution points to .net framework version 4. I have come across answers that suggest changing the framework version to 4.5. But even after that I could not find the .dll in References(Yes, I have checked extensions and framework)
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 have a class library and I have added the reference to System.Web.Mvc v4.00 but for some reason the Filters namespace is unavailable.
I am trying to create a custom controller and I have used ILSpy to look at the existing class. It has a reference to System.Web.Mvc.Filters which I can see when I inspect the assembly but in my project there appears to be no Filters namespace.
Does anyone have any idea why?
Cheers.
I just had this same issue. With the Nuget package manager I had installed the latest MVC 5.2.3 version on the project, but still had the error. With the Nuget package manager it showed that I had indeed had the MVC 5.2.3 but looking in the reference I found that the runtime version was 4.0 and the version was 4.X
I solved the issue by unchecking the box in the Nuget package manager and clicking "OK". This takes MVC out of the project. Then I went back into the manager and installing it again.
Worked for me!
I have just faced the same issue but after i find that i have not imported the name space System.Web.MVC.Filters. After adding this my issue got resolved. You don't need to worry about the runtime version of system.web.mvc
We recently tried to upgrade our software to .net 4.0. We ran into a small snag and rather than spend the time to try to track everything down we decided to revert back to .net 3.5.
We have encountered a few issues like .resx files not properly reverting, but they have been fixed. The final problem we have encountered is a few projects are not building via command line now (everything was before). The error in all cases is as follows.
The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)
We use Visual Studio 2010, msbuild for the command line builds, every project has been changed to a framework of 3.5. The projects will still build in the IDE, but it is fairly time consuming for us to build them all by hand, rather than by our automated script.
It would also be worth noting that all the projects that aren't building are web projects. Within the web.config I don't see a single version=4.0.0.0 reference.
CodesInChaos was partially right. While the UI showed a reference to System.Core, there was no actual reference in the .csproj file. This had to be added in manually. This explains why the UI would build, but the command line wouldn't.