项目模板来自于abp或者52abp
在项目目录运行命令行,执行
dotnet XXXWeb.dll --XXXWeb.dll是启动项如果.net core版本不对,则会提示需要安装某版本的.net core 完成安装即可参考资料
在appsettings.json中设置客户端地址ClientRootAddress
"App": { "ServerRootAddress": "http://localhost:3521/", "ClientRootAddress": "http://localhost:4201/", "CorsOrigins": "*" }发布前记住关闭swagger ui等开发工具 关闭swagger ui,可以选择删去.xml文件,则swagger页面会报错
在angular项目文件中执行
ng build --prod --aot解决相关报错,生成dist文件夹,包括
bundle XXX --XXX是你的项目名在IIS中,新建站点,将XXX文件夹作为根目录 在XXX文件夹中新建文件web.config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="AngularJS" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="/" /> </rule> </rules> </rewrite> </system.webServer> </configuration>在/XXX/assets/appconfig.prod.json中设置service地址remoteServiceBaseUrl
{ "remoteServiceBaseUrl": "http://localhost:3521" }因为Angular无刷新的特性,所以浏览器地址栏上的网址其实不会映射到磁盘的特定位置,所以我们需要安装Microsoft URL Rewrite Module 2.0 for IIS (x64) 注意Angular项目所在目录的访问权限,可以设置为EveryOne
https://blog.csdn.net/qq_32688731/article/details/80996669https://angular.io/guide/deployment#server-configurationhttps://www.cnblogs.com/dennis0525/p/7631245.html
转载于:https://www.cnblogs.com/Lulus/p/10552048.html
相关资源:数据结构—成绩单生成器