.net core An assembly specified in the application dependencied mainfest<****.json>was not found解决办法
2018-06-13 16:23
746 查看
最近在开发项目中,遇到了一个问题.在本机开发中部署到本机iis上或者本机控制台都没有问题,运行正常.当发布部署到服务器(windowsServer)中的时候一直运行不起来,用控制台也运行不起来,直接报错.
怎么更新版本都无法解决.最终看报错信息是因为Microsoft.ApplicationInsights.AspNetCore不存在,找不到.最后在项目中引用它并且发布,发现它并未在发布文件中出现.这是为什么呢?经过查找资料发现是因为VS打包的时候默认认为有一些程序集服务器上是存在的,所以就不把它打包进去.导致程序找不到程序包而异常.可能是我们的服务器版本过低的原因吧,我们服务器上是没有这些程序包的.那怎么让VS打包的时候把这些程序包也一并打包进来呢?其实很简单,只需要一句话而已.
打开项目目录下的csproj文件(记事本打开即可).
然后加上一句代码:
这句话的目的是告诉ide发布的时候把所有用到的程序包都打包出来.然后点击发布.结果发布文件下面多了好多好多的程序集以及其他文件.这时候再把发布文件发布到服务器的iis上的时候运行会发现一切都变得那么美好了.
相关文章推荐
- json-lib 出现net.sf.json.JSONException: There is a cycle in the hierarchy异常的解决办法
- Chrome访问MSDN主页失败,显示The specified CGI application encountered an error and the server terminated the process.的解决办法
- json-lib 出现net.sf.json.JSONException: There is a cycle in the hierarchy异常的解决办法
- net.sf.json.JSONException: There is a cycle in the hierarchy!的解决办法
- The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application的解决办法
- There was an internal api err.. & The entitlements specified in your application’s Code Signing...
- java.lang.IllegalStateException: The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method 解决办法
- java.net.BindException: Address already in use: JVM_Bind <null>:8001解决办法
- Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V解决办法
- .NET Web Deployment Project 编译错误An error occurred when merging assemblies: Index was outside the bounds of the array解决办法
- An unexpected version directory `Objective-C` was encountered for the'<xxx>'Pod in the `xxx`
- 关于json-lib There is a cycle in the hierarchy!问题的3种解决办法
- JSONObject put List<Double> 后转化为String问题的解决办法
- 使用JSONObject.fromObject的时候出现“There is a cycle in the hierarchy”异常 的解决办法
- Icon specified in the Info.plist not found under the top level app wrapper:解决办法
- atitit.解决net.sf.json.JSONException There is a cycle in the hierarchy
- MyEclipse10.7的 at com.genuitec.eclipse.ast.deploy.core.Deployment.<init>错误解决办法。
- Siverlight访问WCF The remote server returned an unexpected response: (404) Not Found 解决办法
- Error 1 Project file must include the .NET Framework assembly 'PresentationCore, PresentationFramework' in the reference
- .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework