|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GAC and FileNotFoundException Can someone help?able to successfully get it working for my asp.net application. The dll is loading from the GAC with correct version and I can verify it from Output window of VS.Net IDE. I can change the policy and it works because I can see the oldversion is redirected to newVersion. The problem is- unless I copy the dll in the bin directory of the application [from where it referenced by other components of the application] I get FileNotFoundException. This entirely defeats the purpose of have the dll in the GAC. I have tried the codebase but asp.net always probes the dll in the temporary directory like the one below- Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc. So, my question is why am I getting the file not found exception while the file is already loaded from GAC? Am I missing something? I would appreciate your comments. Thanks, Prodip Saha Have you set the "Copy Local" property of the assembly reference to False?
Show quoteHide quote "Prodip Saha" <ps***@bear.com> wrote in message news:%23wcqwWzLFHA.3868@TK2MSFTNGP10.phx.gbl... >I am trying to load a shared component like DataAccess from GAC and not >been > able to successfully get it working for my asp.net application. The dll is > loading from the GAC with correct version and I can verify it from Output > window of VS.Net IDE. I can change the policy and it works because I can > see > the oldversion is redirected to newVersion. > > The problem is- unless I copy the dll in the bin directory of the > application [from where it referenced by other components of the > application] I get FileNotFoundException. This entirely defeats the > purpose > of have the dll in the GAC. > > I have tried the codebase but asp.net always probes the dll in the > temporary > directory like the one below- > Attempting download of new URL > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc. > > So, my question is why am I getting the file not found exception while the > file is already loaded from GAC? Am I missing something? I would > appreciate > your comments. > > Thanks, > Prodip Saha > > > > > Scott,
Yes, Local Copy is set to False. Thanks, Prodip Show quoteHide quote "Scott M." <s-mar@nospam.nospam> wrote in message news:OYJTXbzLFHA.1176@TK2MSFTNGP12.phx.gbl... > Have you set the "Copy Local" property of the assembly reference to False? > > > "Prodip Saha" <ps***@bear.com> wrote in message > news:%23wcqwWzLFHA.3868@TK2MSFTNGP10.phx.gbl... > >I am trying to load a shared component like DataAccess from GAC and not > >been > > able to successfully get it working for my asp.net application. The dll is > > loading from the GAC with correct version and I can verify it from Output > > window of VS.Net IDE. I can change the policy and it works because I can > > see > > the oldversion is redirected to newVersion. > > > > The problem is- unless I copy the dll in the bin directory of the > > application [from where it referenced by other components of the > > application] I get FileNotFoundException. This entirely defeats the > > purpose > > of have the dll in the GAC. > > > > I have tried the codebase but asp.net always probes the dll in the > > temporary > > directory like the one below- > > Attempting download of new URL > > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET > > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc. > > > > So, my question is why am I getting the file not found exception while the > > file is already loaded from GAC? Am I missing something? I would > > appreciate > > your comments. > > > > Thanks, > > Prodip Saha > > > > > > > > > > > > you need to tell asp.net compiler where to find the assembly. in the
compilation section of the web config add: <add assembly="<AssemblyFileName>, Version=0.0.0.0, Culture=neutral, PublicKeyToken=<keyvalue>" /> -- bruce (sqlwork.com) Show quoteHide quote "Prodip Saha" <ps***@bear.com> wrote in message news:%23wcqwWzLFHA.3868@TK2MSFTNGP10.phx.gbl... >I am trying to load a shared component like DataAccess from GAC and not >been > able to successfully get it working for my asp.net application. The dll is > loading from the GAC with correct version and I can verify it from Output > window of VS.Net IDE. I can change the policy and it works because I can > see > the oldversion is redirected to newVersion. > > The problem is- unless I copy the dll in the bin directory of the > application [from where it referenced by other components of the > application] I get FileNotFoundException. This entirely defeats the > purpose > of have the dll in the GAC. > > I have tried the codebase but asp.net always probes the dll in the > temporary > directory like the one below- > Attempting download of new URL > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc. > > So, my question is why am I getting the file not found exception while the > file is already loaded from GAC? Am I missing something? I would > appreciate > your comments. > > Thanks, > Prodip Saha > > > > > Bruce,
I have tried it but it did not help- <assemblies> <add assembly="Data.Access,Version=1.0.1902.19083,Culture=neutral,PublicKeyToken= afe57206630e2fsd" /> <add assembly="Interface.Data.Access,Version=1.0.1902.19082,Culture=neutral,Publi cKeyToken=afe57206630e2fsd" /> </assemblies> Will be taking your answer. Thanks. Prodip Show quoteHide quote "Bruce Barker" <brubar_nospamplease_@safeco.com> wrote in message news:OyC4AdzLFHA.2772@TK2MSFTNGP12.phx.gbl... > you need to tell asp.net compiler where to find the assembly. in the > compilation section of the web config add: > > <add assembly="<AssemblyFileName>, Version=0.0.0.0, Culture=neutral, > PublicKeyToken=<keyvalue>" /> > > > -- bruce (sqlwork.com) > > > "Prodip Saha" <ps***@bear.com> wrote in message > news:%23wcqwWzLFHA.3868@TK2MSFTNGP10.phx.gbl... > >I am trying to load a shared component like DataAccess from GAC and not > >been > > able to successfully get it working for my asp.net application. The dll is > > loading from the GAC with correct version and I can verify it from Output > > window of VS.Net IDE. I can change the policy and it works because I can > > see > > the oldversion is redirected to newVersion. > > > > The problem is- unless I copy the dll in the bin directory of the > > application [from where it referenced by other components of the > > application] I get FileNotFoundException. This entirely defeats the > > purpose > > of have the dll in the GAC. > > > > I have tried the codebase but asp.net always probes the dll in the > > temporary > > directory like the one below- > > Attempting download of new URL > > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET > > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc. > > > > So, my question is why am I getting the file not found exception while the > > file is already loaded from GAC? Am I missing something? I would > > appreciate > > your comments. > > > > Thanks, > > Prodip Saha > > > > > > > > > > > > Just wanted to add one comment- application is built with a reference to
non-strong named version of the same dll. I mean the assembly menifest of the ParentAssembly does not have a publickeytoken defined for the Dependent assembly. Example- //ildasm.exe>open>ParentAssembly.dll >manifest ..assembly extern System.Data { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .ver 1:0:5000:0 } ..assembly extern Data.Access { .ver 1:0:1502:29024 //publickeytoken is not there because I did not recompile the ParentAssembly.dll } I applied the strong name and installed in the GAC at a later time. Does this make any difference? Thanks, Prodip Show quoteHide quote "Prodip Saha" <ps***@bear.com> wrote in message news:%23wcqwWzLFHA.3868@TK2MSFTNGP10.phx.gbl... > I am trying to load a shared component like DataAccess from GAC and not been > able to successfully get it working for my asp.net application. The dll is > loading from the GAC with correct version and I can verify it from Output > window of VS.Net IDE. I can change the policy and it works because I can see > the oldversion is redirected to newVersion. > > The problem is- unless I copy the dll in the bin directory of the > application [from where it referenced by other components of the > application] I get FileNotFoundException. This entirely defeats the purpose > of have the dll in the GAC. > > I have tried the codebase but asp.net always probes the dll in the temporary > directory like the one below- > Attempting download of new URL > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc. > > So, my question is why am I getting the file not found exception while the > file is already loaded from GAC? Am I missing something? I would appreciate > your comments. > > Thanks, > Prodip Saha > > > > > Just to let you all know that I got it resolved. My fear came true. I had to
rebuild all the components (used by the app) with the strong named version of the dataaccess dll and all works fine. I don't have to copy dll in the bin directory anymore. The dll can be in the bin directory during the development time just for adding references. However, the framework will use the one from the GAC. Thanks you all for contributing to this thread. Prodip Show quoteHide quote "Prodip Saha" <ps***@bear.com> wrote in message news:%23wcqwWzLFHA.3868@TK2MSFTNGP10.phx.gbl... > I am trying to load a shared component like DataAccess from GAC and not been > able to successfully get it working for my asp.net application. The dll is > loading from the GAC with correct version and I can verify it from Output > window of VS.Net IDE. I can change the policy and it works because I can see > the oldversion is redirected to newVersion. > > The problem is- unless I copy the dll in the bin directory of the > application [from where it referenced by other components of the > application] I get FileNotFoundException. This entirely defeats the purpose > of have the dll in the GAC. > > I have tried the codebase but asp.net always probes the dll in the temporary > directory like the one below- > Attempting download of new URL > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc. > > So, my question is why am I getting the file not found exception while the > file is already loaded from GAC? Am I missing something? I would appreciate > your comments. > > Thanks, > Prodip Saha > > > > >
Other interesting topics
web application security
unicode characters in web form aspx pages, utf-8 DataGrid Sort Expression for a date in format 'dd mmm yy' getting web page - control and class to talk to one another is hard... New Cracked Software(cad,cae,cam,eda,pcb,gis,cfd,cnc...) Runing Client-side code DataSet Disposal Control the size and position of a popup window. Losing state on bound controls in user controls Pop up window |
|||||||||||||||||||||||