I am very new to TFS and I am having trouble with references after checking out a solution and trying to build it. When I build the solution it gives me several error messages such as
"The type or namespace 'AspNet' does not exist in the 'Microsoft' namespace..."
I have tried using NuGet to manage the packages, but I still have 6 errors similar to the one above.
Error 1 The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Error 2 The type or namespace name 'FriendlyUrls' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)
Error 3 The type or namespace name 'IAppBuilder' could not be found (are you missing a using directive or an assembly reference?)
(Errors 4 and 5 reference Optimization and IAppBuilder again.)
Error 6 The type or namespace name 'BundleCollection' could not be found (are you missing a using directive or an assembly reference?)
I cannot figure out how to get the last few errors out, and I need to find a way to avoid having to update my solution every time I check it out of my TFS.
We were dealing with a web site and when we attempted to add this web site to our TFS it was losing our references to all DLL's (including basic web DLL's). We created a shared folder location for our DLL's, copied the DLL's into the shared folder, and then converted our website to a web application using the following tutorial:
Converting a web site to a web application.
After we converted we added the project to our TFS and it worked without any issues.
Related
i have class library project in .net framework 4.6.1. i have to migrate that project into .net 5.
while doing so I am facing error for netNamedPipeBinding.
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'NetNamedPipeBinding' could not be found (are you missing a using directive or an assembly reference?)
following nuget package already installed.
System.ServiceModel.Duplex
System.ServiceModel.Http
System.ServiceModel.NetTcp
System.ServiceModel.Primitives
Any way to to make it work?
Looks like it is not supported.
Named pipes
WCF provided a named pipes binding for communication between processes on the same physical machine. The first release of
ASP.NET Core gRPC does not support named pipes. Adding client and
server support for named pipes (and Unix domain sockets) is a goal for
a future release.
https://learn.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/wcf-bindings#named-pipes
Also, the documentation page for NamedPipeBinding is resolved to .NET 4.8 section and does not exist for .NET 5
https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.netnamedpipebinding
HttpBinding documentation page is there for .NET 5
https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.nethttpbinding
I updated my nuget packages in my ASP.Net MVC application and now I have a ton of errors when building. It looks like some relate to HTML Helpers.
Here is what it says in the error list for one of the errors.
"Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)"
net MVC 2 to asp.net MVC 4 without any problem.
And then, I tried to upgrade entity framework 4.0 to entity framework 6.
The result is not good. I have about 15000 error.
I have this error appear several times
The type or namespace name 'ComplexObject' could not be found
An other error
Error 14331 The type or namespace name 'EdmComplexTypeAttribute' could
not be found (are you missing a using directive or an assembly
reference?)
Error 5460 The type or namespace name 'EdmEntityTypeAttribute' could
not be found (are you missing a using directive or an assembly
reference?)
I don't know where to begin.
Any Idea ?
You need to update templates too. In EF6 some types were moved to different namespaces and the code that is being generated is using namespaces from EF4/5. You can get T4 templates for ObjectContext on VS Gallery. Also take a look at this article about moving your app to EF6 from an earlier EF version.
I attempted a roll back of an Asp.Net MVC project from .Net 4.5 to .Net 4.0 to accommodate older servers in the hosting environment.
Now I am getting many similar errors:
Error 69 The type or namespace name 'Mvc' does not exist in the
namespace 'System.Web' (are you missing an assembly reference?)
I have removed the references in the project and re-added the references several times. Intellisense shows everything as being valid but when I go to compile I still get the above errors.
What is the proper way to rollback a project from 4.5 to 4?
Just off the top of my head, did you try cleaning the solution and/or deleting the contents of the "OBJ" folder?
I have an MVC3 C# .Net web app and I am running aspnet_compiler on my app in order to precompile. I am running this command:
aspnet_compiler -v /dev/boe
Boe is the app in the dev structure under "Default Web Site". The above command is producing this error.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\dev_boe\25d5f53a\2ad742fc\App_Web_vujir5mm.0.cs(29): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'BOE' (are you missing an assembly reference?)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\dev_boe\25d5f53a\2ad742fc\App_Web_vujir5mm.2.cs(29): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'BOE' (are you missing an assembly reference?)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\dev_boe\25d5f53a\2ad742fc\App_Web_vujir5mm.3.cs(29): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'BOE' (are you missing an assembly reference?)
However, Models isn't in our solution. We have our Model objects in a Domain project that is referenced by our web app. It appears that the compiler is expecting a Models reference in our MVC app. Is this true? Or is something else causing this error?
Thanks to David Hirst's suggestion to look at the line of code in the temp file I found the issue:
Basically, there were files that were not included in the Visual Studio solution BUT were still in the file structure on my machine. There were 3 .cshtml files referencing Models. Since the files were not included in the solution, they were not included in a Build using VS. And also, since they were not in the solution, when I did a search for Models, I didn't get any results...but the compiler sweeps the entire directory structure and therefore tried to compile the files with the bad references.
Outstanding lesson in being sure to remove legacy code, and make sure the code base and file structures are in snyc.
I have had a similar error when trying to use the Razor engine on IIS 7.5 (even though .NET 4 was installed!)
If you have a reference in your project as you suggest you may need to go into references, highlight it, go properties and under Copy Local, set this to true. Re-Publish and hopefully this will solve your problem as it did mine.