相关疑难解决方法(0)

传递到字典中的模型项的类型为"mvc.Models.ModelA",但此字典需要类型为"mvc.Models.ModelB"的模型项.

我的一些版本中有这个恼人的错误.

项目中没有错误,因为如果我再次构建,那么问题就会消失.仅当站点部署到Windows 2008 Server时,才会显示该消息.

我首先想到的可能是临时文件的问题,但事实并非如此.我将构建部署到不同的Web,但仍然出现错误.

该错误出现在网站的随机操作上.大多数时间构建都没问题,但每个第3或第4个构建都会产生运行时错误.

我在发布模式下使用WebdeploymentProject构建.视图已预编译.

它不是在ASP.NET MVC中,当使用正确的类型化对象呈现页面时遇到错误的类型错误,因为视图具有完全不同的名称.

我如何调试此问题或如何为此获得帮助?

这是我的WebDeploymentProject

    <!-- 
      Microsoft Visual Studio 2008 Web Deployment Project 
      http://go.microsoft.com/fwlink/?LinkID=104956

    -->
    <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>9.0.21022</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{E5E14CEB-0BCD-4203-9A5A-34ABA9C717EA}</ProjectGuid>
        <SourceWebPhysicalPath>..\B2CWeb</SourceWebPhysicalPath>
        <SourceWebProject>{3E632DB6-6DB3-4BD0-8CCA-12DE67165B48}|B2CWeb\B2CWeb.csproj</SourceWebProject>
        <SourceWebVirtualPath>/B2CWeb.csproj</SourceWebVirtualPath>
        <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>.\Debug</OutputPath>
        <EnableUpdateable>false</EnableUpdateable>
        <UseMerge>true</UseMerge>
        <SingleAssemblyName>B2CWeb_Build</SingleAssemblyName>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugSymbols>false</DebugSymbols>
        <OutputPath>..\B2CWeb_Deploy\</OutputPath>
        <EnableUpdateable>false</EnableUpdateable>
        <UseMerge>true</UseMerge>
        <SingleAssemblyName>B2C_Web</SingleAssemblyName>
        <ContentAssemblyName>
        </ContentAssemblyName>
        <DeleteAppCodeCompiledFiles>false</DeleteAppCodeCompiledFiles>
      </PropertyGroup>
      <ItemGroup>
      </ItemGroup>
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets" /> …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net asp.net-mvc build-process

70
推荐指数
4
解决办法
10万
查看次数

标签 统计

.net ×1

asp.net ×1

asp.net-mvc ×1

build-process ×1

c# ×1