重工电子论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 4064|回复: 1
打印 上一主题 下一主题

MVC 发布的坑 合集

[复制链接]

287

主题

668

帖子

5636

积分

学生管理组

Rank: 8Rank: 8

积分
5636
跳转到指定楼层
楼主
发表于 2018-4-15 21:25:35 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 李维强-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
[C#] syntaxhighlighter_viewsource syntaxhighlighter_copycode
    
  <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>

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

287

主题

668

帖子

5636

积分

学生管理组

Rank: 8Rank: 8

积分
5636
沙发
 楼主| 发表于 2018-5-26 12:23:12 | 只看该作者
部署时,出现用户代码未处理 System.Security.Cryptography.CryptographicException 错误解决方法
在调用证书加密的时候,在本地完全没问题,但是一旦部署到服务器上就错了,只好打开<customErrors mode="Off"/>看看问题,于是乎发现如下

[HTML] syntaxhighlighter_viewsource syntaxhighlighter_copycode
<!-- 
[WxPayException]: 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 。问题解决



回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|cqutlab ( 渝ICP备15004556号

GMT+8, 2024-4-27 11:57 , Processed in 0.173807 second(s), 32 queries .

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表