我在IIS的MVC网站下有一个名为"Files"的虚拟目录.此目录与我的Views目录处于同一级别.当我从我的MVC应用程序链接到文件到我的Files目录下的文件时,我收到以下错误:
路径'/Files/Images/1c7f7eb8-5d66-4bca-a73a-4ba6340a7805.JPG'的控制器未找到或未实现IController.
它认为我的文件VD是一个控制器.如何在没有MVC干扰的情况下像普通VD一样访问我的文件?
谢谢.
我最近在我的WebAPI项目中更新了从v5到v6的EntityFramework.不幸的是,似乎某个地方,不知何故,某个配置中存在一个设置为v5.0的引用.我似乎无法找到它; 我将在下面发布我的web.config.
显示的错误是:
定义了重复的"entityFramework"部分.
我找不到重复的引用,但是如果我删除了单个引用,那么我会收到一条错误说:
{"Message":"发生错误.","ExceptionMessage":"无法加载文件或程序集'EntityFramework,Version = 5.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或其依赖项之一.找到的程序集manifest定义与程序集引用不匹配.(HRESULT异常:0x80131040)","ExceptionType":"System.IO.FileLoadException","StackTrace":"at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalConfigHost host,String typeString,布尔值throwOnError)\ r \n在System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord configRecord,FactoryRecord factoryRecord)\ r \n在System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.在System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey,Boolean&isRootDeclaredHere)的System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord factoryRecord)\ r \n的InitWithRestrictedPermissions(RuntimeConfigurationRecord configRecord,FactoryRecord factoryRecord)\ r \n
这是我的web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<connectionStrings></connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web> …Run Code Online (Sandbox Code Playgroud)