Search Results

Search found 3 results on 1 pages for 'j wynia'.

Page 1/1 | 1 

  • Subsonic Access To App.Config Connection Strings From Referenced DLL in Powershell Script

    - by J Wynia
    I've got a DLL that contains Subsonic-generated and augmented code to access a data model. Actually, it is a merged DLL of that original assembly, Subsonic itself and a few other referenced DLL's into a single assembly, called "PowershellDataAccess.dll. However, it should be noted that I've also tried this referencing each assembly individually in the script as well and that doesn't work either. I am then attempting to use the objects and methods in that assembly. In this case, I'm accessing a class that uses Subsonic to load a bunch of records and creates a Lucene index from those records. The problem I'm running into is that the call into the Subsonic method to retrieve data from the database says it can't find the connection string. I'm pointing the AppDomain at the appropriate config file which does contain that connection string, by name. Here's the script. $ScriptDir = Get-Location [System.IO.Directory]::SetCurrentDirectory($ScriptDir) [Reflection.Assembly]::LoadFrom("PowershellDataAccess.dll") [System.AppDomain]::CurrentDomain.SetData("APP_CONFIG_FILE", "$ScriptDir\App.config") $indexer = New-Object LuceneIndexingEngine.LuceneIndexGenerator $indexer.GeneratePageTemplateIndex("PageTemplateIndex"); I went digging into Subsonic itself and the following line in Subsonic is what's looking for the connection string and throwing the exception: ConfigurationManager.ConnectionStrings[connectionStringName] So, out of curiosity, I created an assembly with a single class that has a single property that just runs that one line to retrieve the connection string name. I created a ps1 that called that assembly and hit that property. That prototype can find the connection string just fine. Anyone have any idea why Subsonic's portion can't seem to see the connection strings?

    Read the article

  • Embedded views and resources (mvc)

    - by Steve Ward
    Hi I've embedded several views in a library so that I can re-use across projects using this method which works OK: http://www.wynia.org/wordpress/2008/12/aspnet-mvc-plugins/ But one view usings a Javascript file. I've tried marking this as an embedded resource and adding it AssemblyInfo.cs and then referencing this resource using <%= ClientScript.GetWebResourceUrl(this.GetType(), "FullPath.FileName.js")%> This is literally displaying this output in the view WebResource.axd?d=nUxqfqAUQLabLU54W I think this is because Im trying to refer to an embedded resource from an embedded resource. Help appreciated as Im going round in circles.. Steve

    Read the article

  • MVC - Loading DLL programmactically

    - by mikechats
    I'm trying to implement a plugable architecture in asp.net MVC. I have based my modules on the following article - http://www.wynia.org/wordpress/2008/12/aspnet-mvc-plugins. I have a DLL that contains a simple controller, and a view. The view is an embedded resource within the DLL. The problem I'm having is, if I drop the DLL in the bin directory of my MVC application manually, then everything works perfectly i.e. the assembly loads correctly. But when I copy the DLL from a file upload input box (via a web form) into the bin directoy, I get an error (The module was expected to contain an assembly manifest.) when trying to load the assembly. I use the same DLL, what could the problem be?

    Read the article

1