相关疑难解决方法(0)

Global.asax中的"分析器错误消息:无法加载类型"

我正在研究MVC3项目并收到以下错误:

分析器错误消息:无法加载类型'GodsCreationTaxidermy.MvcApplication'.

来源错误:

第1行: <%@ Application Codebehind="Global.asax.cs" Inherits="GodsCreationTaxidermy.Core.MvcApplication" Language="C#" %>

我得到的错误是无法加载GodsCreationTaxidermy.Core.MvcApplication但在此屏幕截图中Core部分未显示在错误中:

错误页面截图

有没有人对此错误有任何想法或解决方案?

asp.net asp.net-mvc-3

194
推荐指数
7
解决办法
23万
查看次数

"无法加载类型[Namespace] .Global"让我感到悲伤

在我的.Net 2.0 Asp.net WebForms应用程序中,我的Global.asax包含以下代码:

<%@ Application CodeBehind="Global.asax.cs" Inherits="MyNamespace.Global" Language="C#" %>
Run Code Online (Sandbox Code Playgroud)

但是当我构建时,我得到一个错误陈述 -

无法加载"MyNamespace.Global"类型.

这似乎是因为Global.asax文件中的编译器没有看到MyNamespace命名空间(在文件Global.asax.cs后面的代码中定义)(在R#intellisence中没有显示..).事实证明这是一个非常难以破解...任何帮助将不胜感激!

注意:Global.asax和Global.asax.cs位于同一文件夹中.

注意2:使用csc从vs提示符编译时,编译正常

c# asp.net webforms namespaces global-asax

105
推荐指数
6
解决办法
13万
查看次数

ASP.NET MVC 1.0 AfterBuilding视图在TFS Build上失败

我已经从ASP.NET MVC Beta升级到1.0并对MVC项目进行了以下更改(如RC发行说明中所述):

<Project ...>
  ...
  <MvcBuildViews>true</MvcBuildViews>
  ...
  <Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
    <AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" />
  </Target>
  ...
</Project>
Run Code Online (Sandbox Code Playgroud)

虽然构建在我们的本地开发盒上运行良好,但它在TFS 2008 Build下"无法加载类型'xxx.MvcApplication'"失败,请参阅下面的构建日志:

...
using "AspNetCompiler" task from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "AspNetCompiler"

  Command:
  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v temp -p D:\Builds\xxx\Continuous\TeamBuild\Sources\UI\xxx.UI.Dashboard\\..\xxx.UI.Dashboard 
  The "AspNetCompiler" task is using "aspnet_compiler.exe" from "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe".
  Utility to precompile an ASP.NET application
  Copyright (C) Microsoft Corporation. All rights reserved.

/temp/global.asax(1): error ASPPARSE: Could not load type 'xxx.UI.Dashboard.MvcApplication'.
  The command exited with code 1.

Done executing task "AspNetCompiler" -- FAILED. …
Run Code Online (Sandbox Code Playgroud)

asp.net asp.net-mvc tfsbuild

62
推荐指数
2
解决办法
1万
查看次数

VS 2012基于错误的路径启动应用程序

我有一个应用程序,它在c:\ Dev\MyApp\Main下受源代码管理(TFS 2012).

因为我正在开发一个新功能,所以我决定在c:\ Dev\MyApp\BranchNewFeature上打开一个分支.

我开发了,当我决定是时候测试它就像我没有做任何改变.我点击了F5,我看到了该应用程序的基线版本...看着它我注意到一个非常奇怪的事实:当我检查IIS Express时,应用程序的"启动路径"是旧的(c:\ Dev\MyApp \主要).

任何人都可以帮助我让IIS Express指向新路径吗?(C:\开发\ MyApp的\ BranchNewFeature)

iis version-control iis-express visual-studio-2012

21
推荐指数
2
解决办法
1万
查看次数

ASP.NET无法访问Windows临时文件夹?

每当我想从localhost运行我的应用程序时,它会生成以下奇怪的错误

Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CVT1108: cannot open C:\Windows\TEMP\RESC1C1.tmp for writing

Source Error:



[No relevant source lines]


Source File:    Line: 0 



Show Detailed Compiler Output:

....

CVTRES : fatal error CVT1108: cannot open C:\Windows\TEMP\RESC1C1.tmp for writing
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright …
Run Code Online (Sandbox Code Playgroud)

.net asp.net temp

10
推荐指数
1
解决办法
2万
查看次数