The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' Error? - asp.net

I've downloaded a website and in VS express open it through file => open website. When I press F5 to debug I get build errors:
The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft'
I guess I'm missing a reference but how come it works on the server? References for these projects can be found in the bin directory right?
Under website => start options => build I've set the following: "Build web site" and target framework ".net framework 4" this is the same as the server.
I guess it's looking for a dll that contains Microsoft.aspNet which probably is in totallyUnrelatedName.dll in the folder scratchYourHeadAndLookSomeMore
Could someone help me out and give me a clue as to why Microsoft.aspNet would be missing from my computer?
I'm tempted to quit this job since all projects are web projects without any documentation that won't run locally but do need major changes. Client has no problem to implement changes on the live site but I do.

Go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solution.
Click on the Online Tab.
Search for Microsoft ASP.NET Identity Framework.
Install this package.
Rebuild Solution.

I guess I'm missing a reference but how come it works on the server? References for these projects can be found in the bin directory right?
Not if the used libraries are installed on the server. You might want to install them on your workstation too, or add the proper references (for example via NuGet) and do a bin-deploy.
On how to find out which libraries you're missing: find class names, not namespace names.

I had this error message too so I reinstalled all of my nuget packages again via the package manager console. Unfortunately this did not sort my issue and after loading up a completely separate project within a different solution to the one in which I was experencing: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' error, I noticed that it was occurring there too. This meant that there was an issue with my Visual Studio rather than a problem with individual packages or projects.
It turns out that my MEF Component Cache was corrupted - to fix this I deleted my Visual Studio's component model cache folder which can be found here:
%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Mads Kristensen has created a Clear MEF Component Cache Visual Studio extention which you may find useful:
Clear MEF Component Cache

i have the same issue, on mac vs 2019,
reinstall all Associated nuget of the error you get,
you caמ find them on simpale search on google "nuget + " for example "nuget AddNewtonsoftJson",
then go to "project > manage nuget packages" ...

I try all above solution but It did not resolve my issue.
If still you cannot resolve this following solution might help you
https://www.nuget.org/packages/DotNetOpenAuth.AspNet/
NuGet Installation:
Go to Tools -> NuGet Package Manager -> Package Manager Console
PM> Install-Package DotNetOpenAuth.AspNet

Related

Search for owning NuGet Package of an assembly in Visual Studio 2019

I have an assembly that is causing me problems (Sigil v4.7). I can see that it is in my project (via AppDomain.CurrentDomain.GetAssemblies() and Object Browser).
But I can't figure out what NuGet package brought it in.
Visual Studio has a Tree View of packages:
But short of drilling all the way down all of them, I cannot find a way to see which package is causing an assembly to be included in my project.
Is there a way to search to find which NuGet Package caused Sigil 4.7 to be added to my project?
Looks like you can search for dependencies by name in the solution explorer:
If you can't find it there, you can look at the <Project>.deps.json file in the bin\<Configuration>\<Platform> folder.
For example, I have a project called Potato.csproj building in Debug for net core 3.0, so the file is bin\Debug\netcoreapp3.0\Potato.deps.json
It lists all dependencies, as well as what project a dependency came from.

Error Running UWP Project (UniversalWindows)

I am making a crossplatform xamirin forms application that should run on android and pc windows.
During compiling the UWP version I get the exceptions:
Can not resolve Assembly or Windows Metadata file
'Xamarin.Forms.Platform.WP8.dll
and
Type universe can not resolve assembly: Xamarin.Forms.Platform.WP8,
Version = 1.5.0.0, Culture = neutral, PublicKeyToken = null
I read about these exceptions on the internet and from what I could see, it is related to the Xlabs plugin being used in the application. Is this information correct?
If yes, would I have some way to fix it without removing the Xlabs plugin, why am I using it on multiple forms to be able to checkboxes.
I faced this issues because of Nuget package was not up to date in my every project. I tried to fix this issues using below step.
Close the Visual Studio/Xamarin Studio.
Delete the Nuget package folder from root directory.
Delete the all bin, obj and debug folder from every project folder.
Right click on every project of Package folder and try to update.
Clean the all solution and Rebuild all.

Nuget does not update Package References in ASP.NET website

About: I have a ASP.NET website (not Web project) with 3 class library projects in the solution. Earlier I was using SVN but now Git is used source management. I have installed the git locally on a computer (used as server) and using it for merging the source code from other developers. Also, I am using Visual studio 2015 community edition which provides the tools to work with git.
Problem: After cloning the project from the master repository, I build the project to run it. Building the project shows a dialog box saying "Package Restore is in progress". This process creates a folder named "Packages" and that folder includes every package listed in the packages.config file. But after restoration completes, the project throws the following exception:
This exception shows for each package (Autofac here).
The type or namespace name 'Autofac' could not be found (are you missing a using directive or an assembly reference?)
Work around To Solve this problem, I need to uninstall each package and installed it again and problem is solved. This thing I need to do again and again for each developer machine, which is frustrating and time consuming too.
Does anyone has faced the same problem working with Nuget, git and website in ASP.NET.
I faced a problem like this before. In my case, the reason was that I changed the project path (moved the project to another directory), and the path of the packages directory (that contains the NuGet packages) was stored in the csproj file for the old path, that is VS cannot restore NuGet packages. The solution for this was to edit the csproj manually and make it referring to the correct new packages path.
If this doesn't work for you, you can still use your workaround, but using the following PowerShell command (in NuGet Console) for simplicity:
Update-Package -reinstall -Project Your.Project.Name
Note: project name doesn't contain csproj extension, just the project name
It is good practice to not put third party packages into source control. It bloats your repository (even on a large web application, the size of the external packages will massively out weigh your code).
If NuGet package restore is slow, you could look at using a local cache (this can be as simple as a shared folder) or a better internet connection.
That said, you should only have this problem once per machine. While the packages are downloading you could be giving the new team member an overview of the design…
Make sure that all of your projects are using the same target framework, when this isn't done you can often get the
type or namespace [name] could not be found
warning.
To do this, right click each of the projects in the solution explorer > Properties > Application tab > Target Framework. They should all be the same or there will be incompatibilities between the references in your projects. Here's a question regarding this, hopefully this helps.
The main reason is there no Autofac reference in packages.config file.
When you see on the screen Restore packages message box this mean that nuget package manager is trying to install all the packages which are missing in the package folder.
Try to do this step:
In Visual Studio Solution Explorer pick the project and via context menu pick Unload project
After project was unloaded via context menu pick Edit your project
Go to section group and find you Autofac Reference section
If HintPath doesnt looks like ..\packages\Autofac.4.1.1\lib\net45\Autofac.dll (Actual for 4.1.1 version) remove the Autofac reference Item
Save csproj file and reload project
Install Autofac via NuGet Package manager
Commit and push changes to git repository
Had the same problem with VS 2019. In ASP.NET, packages are updated via the .refresh files that appear in your bin folders. If these aren't checked into Git, they wouldn't be copied down to your cloned repro.
I added the .refresh files for all of my package dlls, made sure the versions and paths in the .refresh files were correct, and now everything updates as expected.

What is Interop.MSutil.dll

First of all i want to say that I'm still a beginner in ASP.NET development. I think this is a simple question but I cant find an answer anywhere. The following is my problem:
I have a big ASP.NET project develped in .NET 2.0 . Now I have to update thisProject to .NET 4.0. I think it worked quite well when I loaded and converted it to .NET 4.0 with VS2010 but there is this missing reference.
The missing reference is MSutil.dll and I don't have any clue what that reference is for an I cant find the dll anywhere either. In the cs code its used like this:
using LogQuery = MSUtil.LogQueryClassClass;
using IisW3cLogInputClass = MSUtil.COMIISW3CInputContextClassClass;
using LogRecordSet = MSUtil.ILogRecordset;
using LogRecord = MSUtil.ILogRecord;
Can anyone tell me...
what this reference is for?
where I can find/download it?
how I can include/install it in my solution?
This is used to read the IIS log files and parse them.
To get that DLL follow those steps:
Download the Log Parser package, here. (free download, small .msi file)
Install the Log Parser on the machine with the your project and Visual Studio.
Browse to the location of the installed program and you will see file called "LogParser.dll" in there. Copy the file to some easy location e.g. "C:\Temp" see below why.
Go to All Programs --> Microsoft Visual Studio 2010 --> Visual Studio Tools and right click "Visual Studio Command Prompt" then choose Run as administrator.
From within the console type:
tlbimp "C:\temp\LogParser.dll" /out:"C:\temp\Interop.MSUtil.dll"
That's it - after this you will have the lost Interop.MSUtil.dll back on your machine, copy it to your project location and add reference to it like you add to any other external DLL file.
Interop.MSutil.dll is a .NET interface to LogParser.dll, primarily used to parse IIS logs.
To use it, you will need LogParser 2.2 installed and LogParser.dll registered on your machine.
Interop.MSUtil is now available via nuget so you no longer have to create it yourself, but after installation you will have to manually add a reference to the DLL in your solution's packages folder.
After adding the reference, right-click it and set Embed Interop Types to false to avoid receiving an error that the classes cannot be embedded.
It seems is an Interop object.
An Interop object is a bridge between a .Net dll and a COM object
Perhaps this link helps you
http://www.fixdllexe.com/Interop.MSUtil.dll-149085.html

Failed to generate binding redirects for 'localhost'. An item with the same key has already been added

Using ASP.NET WebForms in Visual Studio 2010, and adding Glimpse to my WebSite (not WebApp):
I'm trying to install NuGet Package -> Glimpse.
The install is pretty straightforward:
PM> Install-Package Glimpse
Successfully installed 'Glimpse 0.79'.
Successfully added 'Glimpse 0.79' to
localhost.
But then I get an error in pink
Failed to generate binding redirects for 'localhost'. An item with the same key has already been added.
I got an error about a reference to "Microsoft.Web.Infrastructure", which I resolved by finding that DLL and placing it in the bin folder for my Website
Now I'm getting an http 404 error on http://localhost/websiteName/Glimpse/Config
I'm assuming the error is because the config file does not really exist there, and the route it tried to insert into IIS didn't work properly, so the page cannot be found.
Any help would be greatly appreciated, thank you in advance!
I'm a member of the glimpse team. Unfortunately, glimpse 0.79 does not support WebForms out of the box.
I expect that all the issues you have listed here will "disappear" once we have more official support.
If your really keen to get up and running, I recommend grabbing the source from gitHub.com/Glimpse and manually referencing Glimpse.Net.
I've also marked this SO question to make sure that we test out your use case when we are preparing to release with official support for WebForms.

Resources