aspnet / MusicStore

[Archived] MusicStore test application that uses ASP.NET/EF Core. Project moved to https://github.com/aspnet/AspNetCore
1.3k stars 878 forks source link

The current runtime target framework is not compatible with 'MusicStore' #532

Closed ghost closed 8 years ago

ghost commented 9 years ago

The CopyAspNetLoader.cmd is not copying the correct AspNet.Loader.dll - in my case it is pulling the beta4 version. resulting in the following error when in web browser (reference image below):

The current runtime target framework is not compatible with 'MusicStore'.

Current runtime Target Framework: 'DNX,Version=v4.5 (dnx45)'
  Type: CLR
  Architecture: x86
  Version: 1.0.0-beta6-12256

Please make sure the runtime matches a framework specified in project.json 

My work-around was to update the Helios.cmd to accept a parameter so that it can be passed to the CopyAspNetLoader.cmd file (reference code below). e.g., Helios 1.0.0-beta6 so that it will pull from the correct folder using the updated CopyAspNetLoader.cmd shown below.

With this work-around I can now use Helios.cmd without issue to view the MusicStore.

Helios.cmd

SET DNX_HOME=%USERPROFILE%.dnx\

REM copy the AspNet.Loader.dll to the bin folder call CopyAspNetLoader.cmd %1

"%ProgramFiles(x86)%\iis Express\iisexpress.exe" /port:5001 /path:"%cd%\wwwroot"

CopyAspNetLoader.cmd

REM copy the AspNet.Loader.dll to bin folder md wwwroot\bin

SET ASPNETLOADER_PACKAGE_BASEPATH=%USERPROFILE%.dnx\packages\Microsoft.AspNet.Loader.IIS.Interop REM figure out the path of AspNet.Loader.dll

IF [%1]==[] FOR /F %%j IN ('dir /b /o:D %ASPNETLOADER_PACKAGE_BASEPATH%') do (SET AspNetLoaderPath=%ASPNETLOADER_PACKAGE_BASEPATH%\%%j\tools\AspNet.Loader.dll) IF [%1] NEQ [] FOR /F %%j IN ('dir /b /o:D %ASPNETLOADER_PACKAGE_BASEPATH%') do (if [%%j]==[%1] SET AspNetLoaderPath=%ASPNETLOADER_PACKAGE_BASEPATH%\%%j\tools\AspNet.Loader.dll)

echo Found AspNetLoader.dll at %AspNetLoaderPath%. Copying to bin\ copy %AspNetLoaderPath% wwwroot\bin\

Note: in image below there is an access denied during copy because I set the read attribute on the AspNet.Loader.dll (after manually copying the beta6 version into the folder). versioncopyissue

Eilon commented 8 years ago

AspNet.Loader.dll is no longer used, so closing this.