i just installed a new empty ASP.NET 5 WebApplication and got this error when running the app via IISExpress. Any idea what the problem is?
Could not load file or assembly 'dnx.clr.managed' or one of its
dependencies. The system cannot find the file specified. Description:
An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about
the error and where it originated in the code. Exception Details:
System.IO.FileNotFoundException: Could not load file or assembly
'dnx.clr.managed' or one of its dependencies. The system cannot find
the file specified. Source Error: An unhandled exception was generated
during the execution of the current web request. Information regarding
the origin and location of the exception can be identified using the
exception stack trace below. Assembly Load Trace: The following
information can be helpful to determine why the assembly
'dnx.clr.managed' could not be loaded.
=== Pre-bind state information === LOG: DisplayName = dnx.clr.managed (Partial) WRN: Partial binding information was supplied for an
assembly: WRN: Assembly Name: dnx.clr.managed | Domain ID: 3 WRN: A
partial bind occurs when only part of the assembly display name is
provided. WRN: This might result in the binder loading an incorrect
assembly. WRN: It is recommended to provide a fully specified textual
identity for the assembly, WRN: that consists of the simple name,
version, culture, and public key token. WRN: See whitepaper
http://go.microsoft.com/fwlink/?LinkId=109270 for more information and
common solutions to this issue. LOG: Appbase =
file:///C:/Users/Admin/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta7/bin
LOG: Initial PrivatePath = NULL Calling assembly : (Unknown).
=== LOG: This bind starts in default load context. LOG: Configuration file C:\Program Files (x86)\IIS Express\iisexpress.exe.config does not
exist. LOG: No application configuration file found. LOG: Using host
configuration file:
C:\Users\Admin\Documents\IISExpress\config\aspnet.config LOG: Using
machine configuration file from
C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind). LOG: Attempting
download of new URL
file:///C:/Users/Admin/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta7/bin/dnx.clr.managed.DLL.
LOG: Attempting download of new URL
file:///C:/Users/Admin/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta7/bin/dnx.clr.managed/dnx.clr.managed.DLL.
LOG: Attempting download of new URL
file:///C:/Users/Admin/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta7/bin/dnx.clr.managed.EXE.
LOG: Attempting download of new URL
file:///C:/Users/Admin/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta7/bin/dnx.clr.managed/dnx.clr.managed.EXE.
Here is my project.json
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta6"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --config hosting.ini"
},
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
]
}
Dnx versions installed
1.0.0-beta5 clr x64 C:\Users\Admin\.dnx\runtimes
1.0.0-beta5 clr x86 C:\Users\Admin\.dnx\runtimes
1.0.0-beta5 coreclr x64 C:\Users\Admin\.dnx\runtimes
1.0.0-beta5 coreclr x86 C:\Users\Admin\.dnx\runtimes
1.0.0-beta6 clr x64 C:\Users\Admin\.dnx\runtimes
1.0.0-beta6 clr x86 C:\Users\Admin\.dnx\runtimes
1.0.0-beta6 coreclr x64 C:\Users\Admin\.dnx\runtimes
1.0.0-beta6 coreclr x86 C:\Users\Admin\.dnx\runtimes
* 1.0.0-beta7 clr x86 C:\Users\Admin\.dnx\runtimes
1.0.0-rc1-update1 clr x86 C:\Users\Admin\.dnx\runtimes
1.0.0-rc1-update1 coreclr x86 C:\Users\Admin\.dnx\runtimes
1.0.0-rc2-16249 clr x86 C:\Users\Admin\.dnx\runtimes
You declare dependencies on beta6 but use dnx beta7, you should update your dependencies to last stable release 1.0.0-rc1-update1 and use it.
Set also the alias default on 1.0.0-rc1-update1:
dnvm commands
dnvm alias default 1.0.0-rc1-update1 -a x86 -r clr
dnvm use default
Microsoft.AspNet.Server.IIS doesn't exist for rc1, replace it by Microsoft.AspNet.IISPlatformHandler
project.json
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final"
},
You might also uninstall old beta versions and update dnvm to the latest stable version.
Related
I am using the F# Type Provider FSharp.Data.SqlClient in a DLL targeting .Net-Standard-2.0, while this successfully builds in Visual Studio 2019 it fails when I try to build it using the command prompt compiler dotNet compiler with the following error message
J:\Workspaces\DRILQUIP_2456764.0\Applications\EngWeb\Dev\src\EngWeb.Core\BillOfDocuments\BillOfDocumentsDataAccess.fs(14,27): error FS3033: The type provider 'FSharp.Data.SqlProgrammabilityProvider' reported an error: Could not load file or assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058) [J:\Workspaces\DRILQUIP_2456764.0\Applications\EngWeb\Dev\src\EngWeb.Core\EngWeb.Core.fsproj]
J:\Workspaces\DRILQUIP_2456764.0\Applications\EngWeb\Dev\src\EngWeb.Core\BillOfDocuments\BillOfDocumentsDataAccess.fs(14,27): error FS3033: The type provider 'FSharp.Data.SqlProgrammabilityProvider' reported an error: Could not load file or assembly 'System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)
I am using FSharp.Data.SqlClient version 2.0.6 and System.Data.SqlClient Version 4.8.1 and the FSharp.Core version 4.7.0
Any help with this issue will be appreciated
The following line:
let system = System.create "MyActorSystem" <| Configuration.load ()
... produces this output in the F# Interactive window:
Binding session to 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll'...
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeLoadException: Could not load type 'Newtonsoft.Json.Converters.DiscriminatedUnionConverter' from assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
at Akka.Serialization.NewtonSoftJsonSerializer..ctor(ExtendedActorSystem system)
--- End of inner exception stack trace ---
In my project references, Newtonsoft.Json points to .\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll. I've read that I need version 7 or above of Newtonsoft.Json for Akka.NET, so I'm not sure why I'm seeing binding for version 4.5 in the FSI output; is that a false correlation that I should just ignore?
I thought that another copy of the library file might be loading, so in C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\FsiAnyCPU.exe.config, I added:
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.1.0" />
... but then I just get error FS0192: internal error: convMethodRef: could not bind to method in FSI.
I've tried looking in the fusion logs; binding succeeds for the Newtonsoft.Json library, so nothing fishy going on, there.
Anyone else run into this problem?
EDIT: OK so I discovered in the fusion logs that another copy of Newtonsoft.Json.dll, in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\, was intercepting binding. How do I prevent this without simply removing the library file from the Blend folder?
I think your problem is that your not loading the Json.NET from your packages folder:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll
write at the top of the script
#I __SOURCE_DIRECTORY__
this will add the source directory on the probing paths.
your references should resolve correctly.
I recently added a test project to an ASP.NET 5.0 project. The tfs build server is unable to find assemblies for my test project. project.json file below
{
"version": "1.0.0-*",
"description": "ConfigTests test project",
"authors": [ "" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-beta6",
"xunit": "2.1.0-beta4-build3109",
"xunit.runner.dnx": "2.1.0-beta4-build134",
"Moq": "4.2.1507.118",
"ConfigSvc": "3.0.0-*",
"FluentAssertions": "3.5.0"
},
"commands": {
"test": "xunit.runner.dnx"
},
"frameworks": {
"dnx451": { }
}
}
The build outputs errors as such.
Unable to resolve dependency Microsoft.AspNet.Mvc 6.0.0-beta6
Unable to resolve dependency xunit 2.1.0-beta4-build3109
Unable to resolve dependency xunit.runner.dnx 2.1.0-beta4-build134
Unable to resolve dependency Moq 4.2.1507.118
Unable to resolve dependency FluentAssertions 3.5.0
Unable to resolve dependency Microsoft.AspNet.Server.IIS 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.Server.WebListener 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.StaticFiles 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.Diagnostics 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.DataProtection 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.Authentication 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.Authentication.Cookies 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.Authentication.OpenIdConnect 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.Authentication.OAuthBearer 1.0.0-beta6
Unable to resolve dependency Microsoft.AspNet.Cors 1.0.0-beta6
Unable to resolve dependency Microsoft.Framework.Configuration 1.0.0-beta6
Unable to resolve dependency Microsoft.Framework.Configuration.Json 1.0.0-beta6
Unable to resolve dependency Microsoft.Framework.DependencyInjection 1.0.0-beta6
Unable to resolve dependency Microsoft.Framework.OptionsModel 1.0.0-beta6
Unable to resolve dependency Microsoft.Framework.Runtime 1.0.0-beta6
Unable to resolve dependency Microsoft.Framework.Logging 1.0.0-beta6
Unable to resolve dependency Newtonsoft.Json 7.0.1
Using Assembly dependency framework/fx/mscorlib 4.0.0.0
Source: C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll
Using Assembly dependency framework/fx/System 4.0.0.0
Source: C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.dll
Using Assembly dependency framework/fx/System.Core 4.0.0.0
Source: C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Core.dll
Using Assembly dependency framework/fx/Microsoft.CSharp 4.0.0.0
The build command is as follows:
C:\Users\build.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta5\bin\dnx.exe --appbase "C:\Builds\2\A\CI_Config\src\Config\ConfigSvc\ConfigSvcTests" "C:\Users\build.dnx\runtimes\dnx-clr-win-x86.1.0.0-beta5\bin\lib\Microsoft.Framework.PackageManager\Microsoft.Framework.PackageManager.dll" pack "C:\Builds\2\A\CI_Config\src\Config\ConfigSvc\ConfigSvcTests" --configuration Release --out "C:\Builds\2\A\CI_Config\bin"
my project doesnt reference most of these assemblies. I'm curious as to where the tfs build agent is looking for the assemblies. Maybe I am missing something crucial here about dependencies with the project.json file
With regard to the dependencies, those mostly look like dependencies
of Microsoft . AspNet . Mvc which is in your dependency list. As I
understand it you only reference the top level dependencies in your
project.json and the lower level dependencies are worked out. I think that is what you are seeing. InVS 2015 you can drill down on
the dependencies.
To the error: I have not tested it but it seems likely you are running into issues because you are referencing beta6 but are using beta5 dnx in your
build command.
Some useful links:
http://jameschambers.com/2015/07/asp-net-5-beta-6-is-in-the-wild/
http://www.joshgraham.com/upgrading-from-asp-net-beta-5-to-beta-6/
http://davidfowl.com/diagnosing-dependency-issues-with-asp-net-5/
When i build my project targeting .NET 4.0 in visual Studio 2010, i get the following Warning but with no any other error or warning, so the projects runs.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
AssemblyFoldersEx location: "{Registry:Software\Microsoft.NETFramework,v4.0,AssemblyFoldersEx}"
However, i cannot recompile the project with aspnet_compiler
***Microsoft (R) ASP.NET Compilation Tool version 4.0.30319.18408
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.
(0): warning : The following assembly has dependencies on a version of the .NET Framework that is higher than the target and might not load correctly during runtime causing a failure: myProjectName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. The dependencies are: System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. You should either ensure that the dependent assembly is correct for the target framework, or ensure that the target framework you are addressing is that of the dependent assembly.
d:\Projects\Release\SourceCode\web.config(55): warning CS0108: 'ProfileCommon.GetProfile(string)' hides inherited member 'myProjectName.Core.ProfileCommon.GetProfile(string)'. Use the new keyword if hiding was intended.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ec305f94\ca5ad86b\App_Web_i51pzwht.0.cs(28): error CS0234: The type or namespace name 'myModel' does not exist in the namespace 'MedicalService.ViewModel' (are you missing an assembly reference?)*
This post Resolving MSB3247 - Found conflicts between different versions of the same dependent assembly lead me to the utility below which helped me solve the issue.
http://mikehadlow.blogspot.co.uk/2011/02/asmspy-little-tool-to-help-fix-assembly.html
I'm trying to develop an app with ASP.NET MVC Mono.
Installed latest version of Mono and Monodevelop. While trying to run a default "Welcome to ASP.NET MVC on Mono!" app I get the following errors:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review the
specific error details below and modify your configuration file
appropriately.
Parser Error Message: Could not load file or assembly 'System.Web.Mvc,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file specified.
Source Error:
Line 34: Line 35: Line 36: Line 37: Line 38:
Source File: C:\Users\Sergey\Desktop\mvc\mvc\web.config Line: 36
Assembly Load Trace: The following information can be helpful to
determine why the assembly 'System.Web.Mvc, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.
WRN: Assembly binding logging is turned OFF. To enable assembly bind
failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some performance penalty associated with assembly bind failure
logging. To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
Version Information: Microsoft .NET Framework Version:2.0.50727.4927;
ASP.NET Version:2.0.50727.4927
Tried putting System.Web.Mvc.dll from C:\Program Files\Mono-2.10.6\lib\mono\2.0 to bin\ - app still doesn't run, I just get
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
instead of
The system cannot find the file specified.
What should I do?
P.S. My OS is Windows 7.
As suggested in the comment, I'm posting this as an answer ;) When trying to run application which references Mono's assemblies, one can try running it with Mono (not .NET what MonoDevelop does as default) as it uses different GAC.