gpt4 book ai didi

asp.net-mvc - 错误 System.Web.HttpCompileException (0x80004005)

转载 作者:行者123 更新时间:2023-12-02 04:21:21 25 4
gpt4 key购买 nike

我现在突然在一页中收到以下消息。可能是什么问题?

我正在使用 MVC ASP .NET 制作一个网站。

System.Web.HttpCompileException (0x80004005): c: \Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\fcd5a636\19fe4d1\App_Web_create.cshtml.c6727781.9mayykrj.0.cs(162): error CS1528: Expected ; or = (cannot specify constructor arguments in declaration) at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetObjectFactory(String virtualPath, Boolean throwIfNotFound) at System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists(String virtualPath) at System.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext controllerContext, String virtualPath) at System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName(ControllerContext controllerContext, List1 locations, String name, String
controllerName, String areaName, String cacheKey, String[]&
searchedLocations) at
System.Web.Mvc.VirtualPathProviderViewEngine.GetPath(ControllerContext
controllerContext, String[] locations, String[] areaLocations, String
locationsPropertyName, String name, String controllerName, String
cacheKeyPrefix, Boolean useCache, String[]& searchedLocations) at
System.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext
controllerContext, String viewName, String masterName, Boolean
useCache) at
System.Web.Mvc.ViewEngineCollection.<>c__DisplayClassc.<FindView>b__b(IViewEngine
e) at System.Web.Mvc.ViewEngineCollection.Find(Func
2 lookup, Boolean trackSearchedPaths) at System.Web.Mvc.ViewEngineCollection.FindView(ControllerContext controllerContext, String viewName, String masterName) at System.Web.Mvc.ViewResult.FindView(ControllerContext context) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.<>c_DisplayClass1c.b_19() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation) at
System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass1c.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b()
at
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
controllerContext, IList
1 filters, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) at System.Web.Mvc.MvcHandler.<>c_DisplayClass6.<>c_DisplayClassb.b_5() at System.Web.Mvc.Async.AsyncResultWrapper.<>c_DisplayClass1.b_0() at System.Web.Mvc.Async.AsyncResultWrapper.<>c_DisplayClass81.<BeginSynchronous>b__7(IAsyncResult
_) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult
1.End() at System.Web.Mvc.MvcHandler.<>c_DisplayClasse.b_d() at System.Web.Mvc.SecurityUtil.b__0(Action f) at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

最佳答案

这个错误意味着:预期;或=(不能在声明中指定构造函数参数)

形成对类的引用,就像创建该类的对象一样。例如,尝试将变量传递给构造函数。使用 new 运算符创建类的对象。

以下示例生成 CS1528:

// CS1528.cs
using System;

public class B
{
public B(int i)
{
_i = i;
}

public void PrintB()
{
Console.WriteLine(_i);
}

private int _i;
}

public class mine
{
public static void Main()
{
B b(3); // CS1528, reference is not an object
// try one of the following
// B b;
// or
// B bb = new B(3);
// bb.PrintB();
}
}

希望这有帮助。 Source

关于asp.net-mvc - 错误 System.Web.HttpCompileException (0x80004005),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12915673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com