I've been trying to update my Ninject not to meet this bug and I wasn't able to figure out what version of Ninject.Web.Common I have.
Here's a line from packages.config
package id="Ninject.Web.Common" version="3.2.3.0" ...
However, the csproj contains the following line
Reference Include="Ninject.Web.Common, Version=3.2.0.0 ..."
What exactly does the reference version here means?
The version in packages.config is the version nuget will fetch from the server. So when you run nuget restore this will be the version that is downloaded.
The second one is the version that your assembly is searching for at runtime. If you don't load your dependencies from GAC the version will be ignored. Only if your application loads its assemblies from GAC the version will taken into account and the CLR tried to find the assembly with the specified version. Because in the GAC multiple versions of the same assembly can exist.
Have a look at this Question for details about compile time dependencies.
Related
Well I have a problem, we upgraded the .net framework from version 4.0 to version 4.6 of .net, I have about 9 projects running and I had to install masstransit and autofac in 2 projects, this caused some libraries to be updated or installed in other projects.
At the moment in one of the projects(Team.Services) I have installed the 4.5.2 version of the library System.Threading.Tasks.Extensions, before of this I had the version 4.2.0.0, but now I update this. The image below you can see that it is version 4.5.2.
Now when I see the references of the project I can see that I do not have the correct version referenced, it is as if another dll was installed
look for the solution(link below) in other places, also try to change the version in the app.config check the version in the package.config clear the nuget cache and reinstall everything. and it is not working, it keeps looking for the old dll and for this reason it doesn't find the new dll, besides the installations seem to be a different version.
DLL hell - Could not load file or assembly System.Threading.Tasks.Extensions
This is the error:
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
Source=Team.Services
StackTrace:
at Team.Services.ServiceFactory.StartServices(String applicationDirectory) in C:\Users\amilkar.contreras\source\repos\TFS.TeamServices\Common\Team.Services\ServiceFactory.vb:line 110
at Team.ServiceHost.Service.OnStart(String[] args) in C:\Users\amilkar.contreras\source\repos\TFS.TeamServices\Hosts\TeamServiceHost\Service.vb:line 25
at Team.ServiceHost.Service.Start(String[] args) in C:\Users\amilkar.contreras\source\repos\TFS.TeamServices\Hosts\TeamServiceHost\Service.vb:line 34
at Team.ServiceHost.Program.Main(String[] args) in C:\Users\amilkar.contreras\source\repos\TFS.TeamServices\Hosts\TeamServiceHost\Program.vb:line 41
You can have a try the possible solution to solve it:
Confirm the Package Management is Package.config in visual studio, then reinstall this package again
delete .vs folder then restart visual studio
Remove this dll manually, then add the new dll as reference manually
I've been using vscode for editing my unity scripts but lately I haven't been able to use autocomplete for my scripts, for some reason on my older projects intellisense seems to work fine but any new project I try to use it and it just doesn't work, here is the omnisharp output: (and yes, I've installed the targeting pack for this framework version).
I also tried reinstalling vscode and resetting the settings, nothing seemed to work.
Omnisharp server running using Stdio at location 'c:\Users\Lincoln\Documents\Prototype SI' on host 7244.
The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
Failed to load project file 'c:\Users\Lincoln\Documents\Prototype SI\Assembly-CSharp.csproj'.
c:\Users\Lincoln\Documents\Prototype SI\Assembly-CSharp.csproj
C:\Users\Lincoln.vscode\extensions\ms-vscode.csharp-1.18.0.omnisharp\1.32.11\msbuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1126,5): Error: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
Attempted to update project that is not loaded: c:\Users\Lincoln\Documents\Prototype SI\Assembly-CSharp.csproj
Miscellaneous file: c:\Users\Lincoln\Documents\Prototype SI\Assets\Player.cs added to workspace
try to locate the project folder from vs code. click the open folder from vs code and navigate to your project.
I've ran into a weird problem.
I basically have my own web-stack for .NET-core which I've built into a few .dlls, and I want to reference these from another ASP CORE-solution.
VS seems to find the assemblies, where I can navigate types etc.
I can also build the project without any issues, but when IIS then runs the server I get an internal server error stating:
FileNotFoundException: Could not load file or assembly 'myDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
The referenced DLLs are in the debug-folder, and the really weird thing is that if I create a new ASP Core project in the same solution as the web-stack, I can reference and use it without any problems.
Why is this happening only when running on a project outside the web-stack's solution, and what can I do to make it runnable everywhere?
The .NET Core Tooling in VS 2017 (< 15.3 preview) / .NET CLI < 2.0 doesn't fully support referencing assemblies on disk. You need to package the library up as a NuGet package or use a project reference ("same solution"). The technical reason is that all the required assemblies and versions are resolved during compilation and written to the .deps.json file. When loading arbitrary assemblies, this might fail because either the assembly or its dependencies cannot be found (or a conflict with each other).
for load the external dll in core project, needed to:
vs 2017 with version 15.3 or upper.
Microsoft.Extensions.DependencyModel NuGet package installed in your project.
I am new to Visual Studio, so please be patient.
I am working on a product that depends on a dll file that is provided by a third party. We will call them OtherCompany.dll. We do not distribute this.
Our product contains a dll file that is dependent on OtherCompany.dll. We will call it MyCompany.dll. When we build MyCompany.dll, we are currently building against version 1.0.0 of OtherCompany.dll. However, we recently discovered that OtherCompany.dll changed its version to 2.0.0. There were no changes to existing functionality, only additions.
Some users purchased OtherCompany.dll version 2.0.0 and now our product breaks as version 1.0.0 is not in the GAC. I understand this is a common issue, and I have been trying to discover a good solution.
I attempted to add into my .csproj file for our MyCompany.dll and building against OtherCompany.dll version 1.0.0, and install it on a machine with OtherCompany.dll version 2.0.0. It is still failing with the error
Could not load file or assembly 'OtherCompany, Version=1.0.0, Culture=neutral, PublicKeyToken=1234' or one of its dependencies. The system cannot find the file specified.
I understood that would allow MyCompany.dll to be version independent of OtherCompany.dll. What did I do wrong or misunderstand ?
I was able to get things to work by manually adding into the products .config file, but this is cumbersome and I would like something that would continue to work, in case next week OtherCompany.dll releases version 3.0.0.
I want to use Deedle, but it complains like this:
Unknown build error, 'Cannot resolve dependency to assembly
'FSharp.Core, Version=4.3.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded.
When using the ReflectionOnly APIs, dependent assemblies must be
pre-loaded or loaded on demand through the
ReflectionOnlyAssemblyResolve event.'
Being an Android developer normally I'm a bit confused about VS dependencies.
I tried with the Package Manager Console, but it installs only 4.0.0.1 and doesn't know 4.3.0.0.
It seems it is solved with help from this question:
.NET runtime tries to load FSharp.Core 4.3.0 even if all projects reference 4.3.1
In the App.config file there was a binding redirect already to 4.4.0.0. I don't know if I added it earlier or Deedle. When I changed it to 4.0.0.1, which is apparently and confusingly the latest version of FSharp and I could download it with NuGet, it started to work.