我已经在cli上使用带有build-url选项的build命令来构建和部署Angular App,如下所示:
int counter = 1;
var parameterList = new List<SqlParameter>();
SqlCommand command = new SqlCommand();
string sqlCommand = $"UPDATE WITestData SET " +
"Width01 = {widthParameter}, Angle01 = {angleParameter}, Comment01 = {commentParameter}, " +
"Width02 = {widthParameter}, Angle02 = {angleParameter}, Comment02 = {commentParameter}, " +
"Width03 = {widthParameter}, Angle03 = {angleParameter}, Comment03 = {commentParameter}, " +
"Width04 = {widthParameter}, Angle04 = {angleParameter}, Comment04 = {commentParameter}, " +
"Width05 = {widthParameter}, Angle05 = {angleParameter}, Comment05 = {commentParameter}, " +
"Width06 = {widthParameter}, Angle06 = {angleParameter}, Comment06 = {commentParameter}, " +
"Width07 = {widthParameter}, Angle07 = {angleParameter}, Comment07 = {commentParameter}, " +
"Width08 = {widthParameter}, Angle08 = {angleParameter}, Comment08 = {commentParameter}, " +
"Width09 = {widthParameter}, Angle09 = {angleParameter}, Comment09 = {commentParameter}, " +
"Width10 = {widthParameter}, Angle10 = {angleParameter}, Comment10 = {commentParameter} " +
"WHERE ReportNumber = @reportNumber";
var parameters = new object[31];
for (int i = 0; i < WITestData.WIData.Length; i++)
{
//input Parameters into sqlCommand
string widthParameter = $"@width{(counter < 10 ? counter.ToString("D2") : counter.ToString() )}";
string angleParameter = $"@angle{(counter < 10 ? counter.ToString("D2") : counter.ToString())}";
string commentParameter = $"@comment{(counter < 10 ? counter.ToString("D2") : counter.ToString())}";
using (command)
{
parameterList.Add(new SqlParameter(widthParameter, WITestData.WIData[i].Width));
parameterList.Add(new SqlParameter(angleParameter, WITestData.WIData[i].Angle));
parameterList.Add(new SqlParameter(commentParameter, WITestData.WIData[i].Comment));
command.Parameters.Clear();
}
parameters[3 * i] = WITestData.WIData[i].Width;
parameters[3 * i + 1] = WITestData.WIData[i].Angle;
parameters[3 * i + 2] = WITestData.WIData[i].Comment;
counter++;
}
我的脚本可以正常运行,但是资产文件夹中的所有内容都显示控制台为404。我以为deploy url选项可以解决此问题以及脚本?当我检查控制台中的元素时,URL似乎在其前面没有'/ portal/'。
"Surcharges": [
{
"SurchargeType": 50,
"SurchargeTypeSpecified": true,
"LevelSpecified": false,
"Description": "Out of delivery area",
"Amount": {
"Currency": "SID",
"Amount": 32.3
}
},
所以我假设它正在错误的位置寻找资产文件夹?在这种情况下,我不确定使用直接的ng b -deploy-url /portal/
命令来找到不会破坏本地测试的文件夹也将需要什么。
仅在相关时,我已将其作为应用程序部署到Windows 2016服务器中。
答案 0 :(得分:1)
您必须提供相对路径
margin
Angular始终指向angular.json中提供的资产文件夹。