Showing posts with label environment. Show all posts
Showing posts with label environment. Show all posts

Friday, February 17, 2012

Custom assembly : Retrieving data from from configuration file.

Hi all,

my problem is that: I do read informations (e.g. connectionString) from configuration file by one custom assembly.
My environment is RS2005, VS.NET 2005 Prof.Edition, WIN2003 Server SP1, .NET Framework 2.0.50727
The scenario is that:
A text box into my report require a function contained into MyCustom.dll. This code do read information from MyCustom.dll.config.

This file contains:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="IS2009cfg" connectionString="data source=servername\instancename;initial catalog=dbname;user id=xx;password=yy;" />
</connectionStrings>
<appSettings>
<add key="DefaultHeaderLogo" value="This is a test" />
</appSettings>
</configuration>

Using
ConnectionStringSettings conn = ConfigurationManager.ConnectionStrings["IS2009cfg"];
the result is null.

Also using
string defaultHeaderLogo = ConfigurationManager.AppSettings["DefaultHeaderLogo"];
the result is null.

MyCustom.dll and MyCustom.dll.config are located into locations of Report Server and Report Designer, with this Build Events on succesfully build:

rem Copy custom assembly to ReportDesigner location...
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll" "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\MyCustom.dll"
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll.config" "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\MyCustom.dll.config"
rem Copy custom assembly to ReportServer location...
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll" "C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\bin\MyCustom.dll"
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll.config" "C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\bin\MyCustom.dll.config"

The question is simple: where I do locate configuration file for obtain value during report execution?

Many thank's in advance

Claudio Barca
Turin - Italy

Hi, I have the same problem
Do you have solve it?
Thanks

Custom assembly : Retrieving data from from configuration file.

Hi all,

my problem is that: I do read informations (e.g. connectionString) from configuration file by one custom assembly.
My environment is RS2005, VS.NET 2005 Prof.Edition, WIN2003 Server SP1, .NET Framework 2.0.50727
The scenario is that:
A text box into my report require a function contained into MyCustom.dll. This code do read information from MyCustom.dll.config.

This file contains:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="IS2009cfg" connectionString="data source=servername\instancename;initial catalog=dbname;user id=xx;password=yy;" />
</connectionStrings>
<appSettings>
<add key="DefaultHeaderLogo" value="This is a test" />
</appSettings>
</configuration>

Using
ConnectionStringSettings conn = ConfigurationManager.ConnectionStrings["IS2009cfg"];
the result is null.

Also using
string defaultHeaderLogo = ConfigurationManager.AppSettings["DefaultHeaderLogo"];
the result is null.

MyCustom.dll and MyCustom.dll.config are located into locations of Report Server and Report Designer, with this Build Events on succesfully build:

rem Copy custom assembly to ReportDesigner location...
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll" "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\MyCustom.dll"
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll.config" "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\MyCustom.dll.config"
rem Copy custom assembly to ReportServer location...
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll" "C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\bin\MyCustom.dll"
copy "...mydeveloplocation...\bin\Debug\MyCustom.dll.config" "C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\bin\MyCustom.dll.config"

The question is simple: where I do locate configuration file for obtain value during report execution?

Many thank's in advance

Claudio Barca
Turin - Italy

Hi, I have the same problem
Do you have solve it?
Thanks

|||I had the same issue and after much debugging I discovered the ConfigurationManager was not reading from MyAssembly.dll.config, but rather it was accessing the machine.config. I added my connection string to the machine.config file and it starting working.

Tuesday, February 14, 2012

Custom API Development in SQL Server 2005

Hello,

In Visual Studio 2005, you can create custom add-ins that work in that environment, to add additional features that are useful to the developer/analyst. Can you do that with SQL Server? Can you create a custom add-in, and does anyone know of a good resource?

Thanks.

This has been answered in a couple of other posts:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1530544&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1541276&SiteID=1

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/

Custom API Development in SQL Server 2005

Hello,

In Visual Studio 2005, you can create custom add-ins that work in that environment, to add additional features that are useful to the developer/analyst. Can you do that with SQL Server? Can you create a custom add-in, and does anyone know of a good resource?

Thanks.

This has been answered in a couple of other posts:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1530544&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1541276&SiteID=1

Paul A. Mestemaker II

Program Manager

Microsoft SQL Server Manageability

http://blogs.msdn.com/sqlrem/