李维强-15级 发表于 2018-4-15 21:25:35

MVC 发布的坑 合集

本帖最后由 李维强-15级 于 2019-5-6 05:11 编辑

------------------------
解决MVC中使用BundleConfig.RegisterBundles引用Css及js文件发布后丢失的问题
http://www.cnblogs.com/xiaoerlang90/p/5566817.html
解决方案:

在绑定文件BundleConfig的方法RegisterBundles下设置属性:

BundleTable.EnableOptimizations = false;
问题解决。

--------------------------
解决用Asp.net Mvc 开发时出现glyphicons-halflings-regular.woff2 not found的问题
http://www.cnblogs.com/xiaoerlang90/p/5566817.html
   
<system.webServer>
<staticContent>
      <remove fileExtension=".woff"/>
      <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
      <remove fileExtension=".woff2"/>
      <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
    </staticContent>
</system.webServer>

李维强-15级 发表于 2018-5-26 12:23:12

部署时,出现用户代码未处理 System.Security.Cryptography.CryptographicException 错误解决方法
在调用证书加密的时候,在本地完全没问题,但是一旦部署到服务器上就错了,只好打开<customErrors mode="Off"/>看看问题,于是乎发现如下

<!--
: System.Security.Cryptography.CryptographicException: 系统找不到指定的文件。

   在 System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
   在 System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle&amp; pCertCtx)
   在 System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
   在 System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
   在 NF.Wxlib.HttpService.Post(String xml, String url, Boolean isUseCert, Int32 timeout) 位置 e:\Project\这款眼镜\Code\NF\Wxlib\HttpService.cs:行号 68
   在 NF.Wxlib.HttpService.Post(String xml, String url, Boolean isUseCert, Int32 timeout) 位置 e:\Project\这款眼镜\Code\NF\Wxlib\HttpService.cs:行号 105
   在 NF.Controllers.WxRequestController.SendRedPack(String OpenId, Int32 money) 位置 e:\Project\这款眼镜\Code\NF\Controllers\WxRequestController.cs:行号 364
   在 NF.Controllers.WxRequestController.WxOpenIdCallBack() 位置 e:\Project\这款眼镜\Code\NF\Controllers\WxRequestController.cs:行号 284
   在 lambda_method(Closure , ControllerBase , Object[] )
   在 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
   在 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20()
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult)
   在 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   在 System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult)
   在 System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   在 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   在 System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   在 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   在 System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult)
   在 System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
   在 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->

处理方法:
IIS 应用程序池--选中你网站的所配置的应用程序池--右键 选择 “高级配置” --将“加载用户配置文件” 设置为True 。问题解决



页: [1]
查看完整版本: MVC 发布的坑 合集