简体   繁体   中英

The system cannot find the file specified. error for .p12 certificate file

I have used a .p12 certificate file given by google to fetch the data from google analytics API. All things work fine in my pc with visual studio dev server. but when I publish it to the production IIS server, I get "The system cannot find the file specified." error.

the code to to get the file path,

var keyFilePath = System.Web.HttpContext.Current.Server.MapPath("~/Content/xxxxxx.p12");

Can anyone help me to sort out this issue?

Finally found the solution. when it is running in IIS, I need to set "Load User Profile" to True in the application pool's advanced settings to be able to load a cert by filename & password

According to your descritpion, I suggest you could firstly check your IIS application folder to make sure you have copy the .p12 certificate file to the IIS folder.

I guess you miss copy the file when publish the application to IIS.

I suggest you could right click the .p12 certificate file in VS and click copy always as below:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM