c# - File not found exception/w3wp.exe issue in IIS on test server but no issues in IIS Express locally -
i needed upgrade google api oauth 2 (but still use old gdata apis) , used this post exclusively, works great locally via iis express.
for convenience code is:
using system; using system.io; using system.security.cryptography.x509certificates; using autofac; using d.core.intelligence; using google.apis.auth.oauth2; using google.gdata.analytics; using google.gdata.client; namespace d.analytics { public class analyticsmodule : module { private const string serviceaccountemail = "3504f5u6sqlm@developer.gserviceaccount.com"; private static readonly string keypath = path.combine(appdomain.currentdomain.setupinformation.privatebinpath ?? appdomain.currentdomain.basedirectory, "key.p12"); private static readonly x509certificate2 certificate = new x509certificate2(keypath, "notasecret", x509keystorageflags.exportable); private readonly serviceaccountcredential _credential = new serviceaccountcredential( new serviceaccountcredential.initializer(serviceaccountemail) { scopes = new[] { "https://www.googleapis.com/auth/analytics" } }.fromcertificate(certificate)); protected override void load(containerbuilder builder) { builder.register(c => { _credential.requestaccesstokenasync(system.threading.cancellationtoken.none).wait(); var service = new analyticsservice("d.com"); var requestfactory = new gdatarequestfactory("razbot2.0"); requestfactory.customheaders.add(string.format("authorization: bearer {0}", _credential.token.accesstoken)); service.requestfactory = requestfactory; return service; }); builder.registertype<analyticsnewslettertrackingsource>().as<inewslettertrackingsource>(); builder.registertype<analyticssearchtrackingsource>().as<isearchtrackingsource>(); builder.registertype<analyticsemaillinktracker>().as<iemaillinktracker>(); } } } now (seems) work locally, when upload test server w3wp.exe exception, i'm afraid have no experience debugging.
i downloaded source test server , tried attach process application debug point, get:
http://i.imgur.com/knm2qeu.png
i guess falls apart at:
unhandled exception @ 0x000007fd71459f99 (ntdll.dll) in w3wp.exe: 0xc0000374: heap has been corrupted (parameters: 0x000007fd714ae610). the entire symbol loading process at: http://pastebin.com/czc8e0cr
the inner exception is:
at system.security.cryptography.cryptographicexception.throwcryptographicexception(int32 hr) @ system.security.cryptography.x509certificates.x509utils._loadcertfromblob(byte[] rawdata, intptr password, uint32 dwflags, boolean persistkeyset, safecertcontexthandle& pcertctx) @ system.security.cryptography.x509certificates.x509certificate.loadcertificatefromblob(byte[] rawdata, object password, x509keystorageflags keystorageflags) @ system.security.cryptography.x509certificates.x509certificate2..ctor(byte[] rawdata, string password, x509keystorageflags keystorageflags) @ d.analytics.analyticsmodule..cctor() with message:
the system cannot find file specified. contrary message claim: path file accurate i've checked myself via debug point. build action set 'content' , 'copy if newer' , i've read in values of .p12 certificate bytearray , fed constructor itself, no luck!
it case i'm doing silly in code rather more deep baffles me why doesn't throw exceptions locally!
http://forums.iis.net/p/1226705/2104281.aspx?p=true&t=635720164781539549
answer above, writing sentence because body of posts must @ least 30 characters apparently. lorum ipsum.
Comments
Post a Comment