EDIT: I modified the question title
after understanding the actual
problem.
I tried to run the sample RSS reader from Codeplex. I tried it on CTP version of the Windows Phone Developer Tools and it worked ok on that.
But now after trying it on beta version of the tools, it gave me following error.
The type or namespace name 'Phone' does not exist in the namespace 'Microsoft'
(are you missing an assembly reference?)
Its not able to locate the assembly Microsoft.Phone.Controls. Though I've installed beta tools successfully on my machine.
What could be the problem?
There are large changes in the namespaces and dlls between CTP and Beta. Most of the Microsoft.Phone namespaces have been merged into a single dll, when in the CTP they were in separate dlls.
You'll need to basically remove the invalid references you see in the project tree, and then resolve the missing references in each file.
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.
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.
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.
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.)