Visual Studio looks for dll in the wrong directory - asp.net

I am getting an error of "Could not load file or assembly 'Microsoft.AI.Web' or one of its dependencies" in the browser of my asp.net app. Microsoft.AI.Web is from Microsoft.ApplicationInsights.Web NuGet package.
I noticed this:
LOG: Appbase = file:///D:/Source/Workspaces/AppName/Branches/Main/Application/WT/
LOG: Initial PrivatePath = D:\Source\Workspaces\AppName\Branches\Main\Application\WT\bin
the dll in question is located at D:\Source\Workspaces\AppName\Branches\Main\Application\packages\Microsoft.ApplicationInsights.Web.2.4.1\lib\net45\Microsoft.AI.Web.dll
As for personal dll's -- In the project-->properties-->build-->output path--> I have it set as "..\Any\Debug\". When I build the project the DLL's populate there.
I checked References and code in .csproj file and all the dll are located where I specified to.
I am not sure why it's trying to look at the bin file of the project when I told the output is somewhere else AND to look for the dlls in that same folder(through references and .csproj file). How do I make it so that VS will look for the dlls in the folder path I want instead of "WT\bin"?
When I change my project output path to "bin", it can detect the dll's there EVEN though the path of the dll remains the same( D:\Source\Workspaces\AppName\Branches\Main\Application\packages\Microsoft.ApplicationInsights.Web.2.4.1\lib\net45\Microsoft.AI.Web.dll).

Since it's a Microsoft strong signed DLL, add it to the server's GAC.
If you place it in the GAC, it'll find the file automatically. Another plus there is that if you need it for another project deployed on the same server, you don't need to deploy it again.
Here's some information on how to install a DLL into the GAC on the server machine, assuming gacutil is not installed there. Look at the accepted answer, not the question.
Drag and drop a DLL to the GAC ("assembly") in windows server 2008 .net 4.0
Copy gacutil.exe and gacutil.exe config from your machine to the server's C:\Windows\Microsoft.NET\Framework\v4.0.30319
Then run on the server:
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\gacutil.exe" /i "PATH TO YOUR DLL"

Related

Finding assemblies for a Universal or .NET Core app

When I create a new Universal application (with VS 2017), I see "Microsoft.NETCore.UniversalWindowsPlatform" as a reference. This seems to just signify that a host of actual assemblies are implied (I see System.AppContext.dll, System.Collections.dll, and many more in the project bin\x86\Debug folder after building the project).
Do these files exist somewhere on my machine and copied to the bin folder when building? Or are they downloaded via Nuget when building? (I know that they are not the usual .NET Framework files in the usual .NET Framework locations).
How do I know which assemblies are implied by "Microsoft.NETCore.UniversalWindowsPlatform" without actually building? (Visual Studio must get this information from somewhere since it knows which to add to the bin folder).
If you want to reflect on these assemblies for a specific project (for example, as part of a code refactoring process) without actually building the project, where would you find these assembles?
UAP target platform (previously netcore50) (https://learn.microsoft.com/es-es/dotnet/standard/frameworks)
it's located in 'C:\Program Files (x86)\Microsoft SDKs\NETCoreSDK'
You can take a look at the nuget file 'C:\Program Files (x86)\Microsoft SDKs\NETCoreSDK\Microsoft.NETCore.UniversalWindowsPlatform\5.0.0\Microsoft.NETCore.UniversalWindowsPlatform.nuspec' and see his dependencies or using nuget.org (https://www.nuget.org/packages/Microsoft.NETCore.UniversalWindowsPlatform/)
Most of his dependencies are located in the same folder (C:\Program Files (x86)\Microsoft SDKs\NETCoreSDK), so you can take a look at the dlls (for example C:\Program Files (x86)\Microsoft SDKs\NETCoreSDK\System.Collections.Immutable\1.1.37\lib\dotnet\System.Collections.Immutable.dll)

Could not load file or assembly Devart.Data

I have such issue.
On my PC where VS is installed and project is developing I use Devart linqconnect.
I set option "Copy Local" for Devart.Data.Linq, Devart.Data.SQLite and Devart.Data.SQLite.Linq to true. All goes OK.
When try to run application on client side error Could not load file or assembly 'Devart.Data, Version=5.0.828.0 ... appears. What can be solution for this?
It is also necessary to add the Devart.Data assembly of the corresponding version to your project and set Copy Local for it to True.
To deploy applications written with the help of LinqConnect you should register run-time assemblies Devart.Data.SQLite.dll, Devart.Data.dll, Devart.Data.SQLite.Linq.dll and Devart.Data.Linq.dll at Global Assembly Cache (GAC) or place them to the bin folder of your application.
JIC: these assemblies can be found in the folder where LinqConnect is installed.

unable to update auto-refresh reference 'ajaxcontroltoolkit.dll and commonlogging.dll

unable to update auto-refresh reference 'ajaxcontroltoolkit.dll and
commonlogging.dll
I am getting this warning every time I build the project but the project is running fine without breaks in local system but I am getting error page in godaddy after uploading to server. is this the reason for 500 error in godaddy shared hosting server?
I had this same problem with the AjaxControlToolkit. I've got no idea what caused it, but by simply re-installing the toolkit into my project with NuGet, that fixed it.
Install the package by following the steps below:
Right-click on your project and select Manage NuGet Packages.
Search the online repository for the package you want. In my case, this was 'ajaxcontroltoolkit'.
Find the package in the list of results that appears and click the Install button on it.
What this does is it removes all previous references of the package (older DLLs and references in your web.config file) and replaces them with newer, correct references
It's that simple.
Hope this helps you
Look in the bin folder of the project - for a file called - in your case:
ajaxcontroltoolkit.dll.refresh
This will have an incorrect path to the dll file. You need to update the path to wherever the dll is now.
Had this same issue and manually creating a .refresh file for its DLL helped. Once I figured the origin of the relative path is the solution folder, and put that in the .refresh, everything worked for this and other references.
I hope this helps somebody...
Im using VS2017 and had an ASP project with 28 Warnings:
Unable to update auto-refresh reference 'XXXXX.dll'. Cannot find
assembly 'F:\Program Files (x86)\Microsoft Web Tools\Packages\…
...well...that directory had been removed!
To make matters worse (or better) when I create a new ASP project the references are handled a little different in solution explorer...and the assemblies referenced in the new project are in C:\Program Files (x86)\Microsoft Visual Studio\Shared
To fix my warnings...I edited the .refresh file.
You can do this by: 1: Double clicking the warning. 2: Navigate to it
in solution explorer under the Bin folder.
And changed (example)
..\..\..\..\..\..\..\Program Files (x86)\Microsoft Web Tools\Packages\AspNet.ScriptManager.bootstrap.3.0.0\lib\net45\AspNet.ScriptManager.bootstrap.dll
to
C:\Program Files (x86)\Microsoft Visual Studio\Shared\Packages\AspNet.ScriptManager.bootstrap.3.0.0\lib\net45\AspNet.ScriptManager.bootstrap.dll
I had the same issue / what solved it for me was simply to do a "Refresh folder" on the Bin folder.

Deployment Issue

I'm trying to host a website i'm getting an error regarding assemblies.I have added the assemblies to the bin folder also.Fllowing is the error page
http://d3430264.u711.laknetwork.com/real/login.aspx
I believe this is a version related issue. You may have dropped a dll into bin but it's version does not match with the expected one.
You can edit the AssemblyInfo.cs to have the version tag as this [assembly: AssemblyVersion("1.0.0.0")] . And then clean the solution and redeploy
Do one thing, before publishing, select the reference and open its properties window. See if there you have option copy to local. It sounds the assembly resides in GAC and is not available while deployment. Or you can copy paste the same version assmbly in target machine in System32 directory or local bin and register using regasm /tlb (managed dll) , regsvr32 (unmanaged).

Could not load file or assembly 'Intelligencia.UrlRewriter' or one of its dependencies. The system cannot find the file specified

i am installing URL rewriting DLL (from http://urlrewriter.net/) to GAC. (if i keep dll in BIN folder it works perfectly)
but keeps throwing error.
Could not load file or assembly 'Intelligencia.UrlRewriter' or one of its dependencies. The system cannot find the file specified. (E:\Test\web.config line 28)
wondering is it because dll is http module.. and installed in GAC creating problem ? (because rest all dlls work perfectly fine in GAC)
i looked in to all internet resource for this error. but didn't find proper solution.
attached test project with dll added into bin folder.
http://rapidshare.com/files/449306116/Test.rar
please advise.

Resources