validation error when project parameter sensitive property is set to true in SSIS 2012 - visual-studio-2012

I am using SSIS 2012 and deploying projects via project deployment model. I have 3 project connection managers and passing the password information to the connection manager through a project parameter. When I set the Sensitive property of password parameter to False the package runs fine but when I set it to true it gives the below error :
Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "ConnManager" failed with error code 0xC0202009

It is erroring because you are trying to touch a Parameter that is marked as Sensitive. You cannot use the "old" approach for configuring connection managers. For the project deployment model and Connection managers, in the SSISDB, you right click on the project and select Configure.
There is where you overlay a password.
Otherwise, you then need to use the GetSensitiveValue method to access the value instead of the standard Getter property.
Dts.Variables["$Package::FtpPassword"].GetSensitiveValue().ToString();
See Matt's article Retrieving the Value of a Sensitive Parameter in a Script

Related

SqlDataProvider connection string in Suave on Azure

I can't get SqlDataProvider to work when executed in a fsx script which is running in an Azure Web Site.
I have started from the samples that Tomas Petrecek has here: https://github.com/tpetricek/Dojo-Suave-FsHome.
In short it is a FSX script that is executed using the IIS httpPlatformHandler so that all http requests to my Azure Web site is forwarded to my F# script.
The F# Script use Suave to handle the requests.
When I tried adding some database access to my HTTP handlers I got into problems.
The problematic code looks like this:
[<Literal>]
let connStr = "Server=(localdb)\\v11.0;Initial Catalog=My_Database;Integrated Security=true;"
[<Literal>]
let resolutionFolder = __SOURCE_DIRECTORY__
FSharp.Data.Sql.Common.QueryEvents.SqlQueryEvent |> Event.add (printfn "Executing SQL: %s")
// the following line fails when executing in azure
type db = SqlDataProvider<connStr, Common.DatabaseProviderTypes.MSSQLSERVER, ResolutionPath = resolutionFolder>
let saveData someDataToSave =
let ctx = db.GetDataContext(Environment.GetEnvironmentVariable("SQLAZURECONNSTR_QUERIES"))
.....
/// code using the context here
This works just fine when I run it locally, but when I deploy it to the azure site it will fail at the line where the type dbis created.
The error message is (line 70 is the line that has the type db = ...:
D:\home\site\wwwroot\app.fsx(70,11): error FS3033: The type provider
'FSharp.Data.Sql.SqlTypeProvider' reported an error: A network-related
or instance-specific error occurred while establishing a connection to
SQL Server. The server was not found or was not accessible. Verify
that the instance name is correct and that SQL Server is configured to
allow remote connections. (provider: SQL Network Interfaces, error: 52
- Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database
Runtime feature is enabled.)
The design-time database in the connStr is not available in the azure site, but I thought this is why we have the GetDataContext overload that takes a connection string to be used at run-time?
Is it because it is running as a script and not as compiled code that it is trying to access the database when creating the TypeProvider?
If yes, does it mean that my only option is to compile and provide the database code as a compiled assembly that I load and use in my Suave FSX script?
Reading the connection string from a config file does not work very well as this is in a azure site. I really need to get the connection string from an environment variable (which is set in the azure management interface).
Hmm, this is a bit unfortunate - as #Fyodor mentioned in the comments, the problem is that the script-based deployment to Azure actually compiles the script on the Azure machine - and so you need to have a statically-resolved connection string that works on Azure.
There are two options:
Use compiled project instead. If you compile your F# code locally and deploy the compiled code to Azure it will work. Sadly, there are no good samples for that.
Do some clever trick to make the connection string accessible to the script at compile time.
Send a PR to the SQL provider so that you can give it the name of an environment variable and it reads the connection string from there.
I think (3) would actually be quite nice and useful feature.
I'm not necessarily sure what the best way to do (2) would be. But I think you might be able to modify app.azure.fsx so that it creates a file (say connection.fsx) that contains something like:
module Connection
let [<Literal>] ConnString = "<Contents of SQLAZURECONNSTR_QUERIES>"
Then app.fsx could load this script and use Connection.ConnString in the argument of SQL type provider.

WebSphere Database Federated Repository

I'm trying to add a DB2 database repository to my federated repository. I'm using Websphere version 8.0.
I've been running through Paul Ilechko's instructions (http://www-128.ibm.com/developerworks/websphere/techjournal/0701_ilechko/0701_ilechko.html) and I keep getting stuck at Step 3 (Set up the repository by using this wsadmin command to create the wimDB tables). I keep getting this error:
com.ibm.websphere.wim.exception.WIMSystemException: com.ibm.websphere.wim.exception.WIMSystemException: CWWIM1999E An exception occurred during processing: com.ibm.db2.jcc.DB2Driver
I did a search and it says I should set the Environment Variable DB2_JDBC_DRIVER_PATH to /home/.../sqllib/java/ for the scopes Node=Node, Node=Node01, Node=CellManager.
I tested the data source connection via the WAS Console and it worked, so I don't know what I did wrong. Got any ideas what could cause this?
You can easily set required Environment variable.
Move to: Environment -> WebSphere Variables
Set Cell scope
Create DB2_JDBC_DRIVER_PATH

Server Error in '/DotNetNuke_Community' Application

I'm getting the following error when attempting to run DotNetNuke 7.1 from IIS.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 572: //first call GetProviderPath - this insures that the Database is Initialised correctly
Line 573: //and also generates the appropriate error message if it cannot be initialised correctly
Line 574: string strMessage = DataProvider.Instance().GetProviderPath();
Line 575: //get current database version from DB
Line 576: if (!strMessage.StartsWith("ERROR:"))
I've tried running it from Visual Studio 2012 after downloading and extracting the source code to a folder, then running, but I get the same error (also, VS loads about 13 instances of it's built in webserver which can't be correct).
Clearly, there is something wrong with the database. From what I've read in the past, there should have been a start up configuration page (for configuring settings the first time you run the project).
I did look at the local version of IIS (running on Windows 8) and it created the site fine there, however, for some reason the internal webserver attempts to run (and the option to run on an external IIS is greyed out).
Anyone run into this problem with DNN Community edition? I've tried running as admin and setting permissions with no luck at all.
Any way to fix this?
Ok, the key is to delete the Database.mdf file completely.
Then create a new empty database of your choice in SQL Server (2008 or greater).
Create a new user account with db_owner access (as it must be able to create tables, etc).
Change the connection strings in the release.config and development.config to connect to the database.
DELETE the web.config file.
RENAME either config file to "web.config"
Set the default project to the web project in VS
set the default page to default.aspx
Run
I made the erroneous assumption that running the app would rename the config file for me (not sure why I assumed that).
SOLVED!

Selenium and TFS Test cases Datasource

I am usimg VS 2010 Professional.And want to connect the TFS Testcase datasource without using MTM(Microsofot Test Manager).Is it Possible to do so.
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.TestCase",
"http://TFS URL", "27211",
DataAccessMethod.Sequential), TestMethod]
public void CheckUserLogin()
{
PageObjects.BrowserInvoke();
PageObjects.TextBox(UIMapRepository.userName, TestContext.DataRow["UserName"].ToString());
PageObjects.TextBox(UIMapRepository.passWord, TestContext.DataRow["Password"].ToString());
PageObjects.ButtonClick(UIMapRepository.loginButton);
Assert.AreEqual("Logout", PageObjects.CheckElementExist(UIMapRepository.logoutButton));
PageObjects.ButtonClick(UIMapRepository.logoutButton);
PageObjects.CloseBrowser();
}
When I run this I get
The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
Error details: TF30063: You are not authorized to access tfs.
The remote server returned an error: (401) Unauthorized.
Can not connect to Team Foundation Service data source for coded ui tests has a similar issue.
I suspect you'll need to pass the authentication credentials along with the URL in the TFS connection string.
How do you connect to a TFS server in C# using specific credentials? shows how to connect programmatically. You should be able to wrap that into a format that the DataSource attribute will accept.

How to re-enable Orchard CMS features without Dashboard or command line

I just disabled the Comments feature on my Orchard installation, not realising it was a dependency of Disqus, and now the entire site including admin dashboard fails with this error:
None of the constructors found with policy 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Disqus.Comments.Services.DisqusCommentUpdateService' can be invoked with the available services and parameters: Constructor 'Void .ctor(Orchard.IOrchardServices, Disqus.Comments.Services.IDisqusMappingService, Orchard.Comments.Services.ICommentService)' parameter resolution failed at parameter 'Orchard.Comments.Services.ICommentService commentService'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Autofac.Core.DependencyResolutionException: None of the constructors found with policy 'Orchard.Environment.AutofacUtil.DynamicProxy2.ConstructorFinderWrapper' on type 'Disqus.Comments.Services.DisqusCommentUpdateService' can be invoked with the available services and parameters: Constructor 'Void .ctor(Orchard.IOrchardServices, Disqus.Comments.Services.IDisqusMappingService, Orchard.Comments.Services.ICommentService)' parameter resolution failed at parameter 'Orchard.Comments.Services.ICommentService commentService'.
The Orchard installation is running on a web host and I do not have access to the command line there. I have FTP access, and access to the MS SQL database. Is there any way I can re-enable the Comments feature without access to the command line or web admin interface?
There is a file, /orchard.web/app_data/cache.dat, which is an xml containing a list of which features are enabled.
The documentation warns that modifying it may have unpredictable results, so be warned: http://docs.orchardproject.net/Documentation/Developer-FAQ#What'sinApp_Data?
There is a table in the database called Settings_ShellFeatureStateRecord, which stores the state for each module's feature. I re-enabled Orchard.Comments on my local installation (using SQL Server Compact Edition) with the following SQL:
update Settings_ShellFeatureStateRecord
set InstallState = 'Up',
EnableState = 'Up'
where Name = 'Orchard.Comments'
Good luck!

Resources