473,378 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

That assembly does not allow partially trusted callers: How to solve that in VB2008?

I used VB.Net 2005 to get a dataset from SQL server database and write to a text file. I had connection string in app.config file. I published this console application to server with strong name key file. It worked nicely.

Recently, I have VS 2008 and would like to learn. I create a same project, create a new strong name key file in 2008, same procedures as the application in vb.net 2005. When I publish to the same server, it has an error, "An error occurred creating the configuration section handler for dataConfiguration: That assembly does not allow partially trusted callers. (V:\PayrollChecks\Bin\Payroll_Offcycle_Report.exe. config line 6)".

How do I solve this problem? What makes it work in vb 2005 but not in 2008?

Here are partial of the codes. The error happens at "Create Database" section.
Expand|Select|Wrap|Line Numbers
  1. Sub Main()
  2.         On Error GoTo AppErr
  3.         Dim ds As DataSet
  4.         Dim db As Database
  5.         Dim cmd As DbCommand
  6.  
  7.         Dim report As String
  8.         Dim st As String
  9.         Dim oFile As System.IO.FileInfo
  10.         Dim fWriter As System.IO.StreamWriter = Nothing
  11.  
  12.         report = "D:\reports\PAYROLL_OFFCYCLE.rpt"
  13.         oFile = New System.IO.FileInfo(report)
  14.         If oFile.Exists() Then
  15.             oFile.Delete()
  16.         End If
  17.  
  18.         fWriter = New System.IO.StreamWriter(report, True)
  19.  
  20.         st = "Create Database:  "
  21.         db = DatabaseFactory.CreateDatabase()
  22.  
  23.         st = "Assign Command:  "
  24.         cmd = db.GetStoredProcCommand("Payroll_OffcycleCheck_Rpt")
  25.  
  26.         st = "Execute Command:  "
  27.         ds = db.ExecuteDataSet(cmd)
  28. ...
  29. End Sub
  30.  
  31. app.config file:
  32. <?xml version="1.0" encoding="utf-8" ?>
  33. <configuration>
  34.     <configSections>
  35.         <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  36.     </configSections>
  37.     <dataConfiguration defaultDatabase="database name"/>
  38.     <connectionStrings>
  39.         <add name="database name" connectionString="Persist Security Info=True;Data Source=database name;Server=server name;User ID=use id;Password=pw"             
  40.          providerName="System.Data.SqlClient" />        
  41.     </connectionStrings>    
  42. </configuration>
  43.  
  44.  
Please help!

Thank you very much,

Tammie Dao
Nov 19 '10 #1
0 1312

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: g3000 | last post by:
I developed on a Win2K3 Server with VS 2005 Published a web app to my local drive. Copied that folder to a Win2K3 Server. Configured a new virtual directory Moved the files there. Modified...
1
by: Pierre | last post by:
Hi all, I have developped a set of WSs and everything works fine when I try it on my local network. When I export them on my host's server though I get the following error on my client: ...
2
by: Vandana T | last post by:
I created a console application to read and manipulate an Excel file. I added reference to the Microsoft Excel 11.0 Object Library. When I place it in Network Drive and try to run the .exe from my...
1
by: Matt Culbreth | last post by:
Hello All, I've got a very simple ASP.NET 2.0 application which uses a DLL from a third party. I don't have the source to this DLL. Everything has been working fine on my XP development...
5
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
From the amount of articles about this one I’m sure this gets asked a lot, but I haven’t yet found a succinct article which explains what is required in its entirety. I work using Visual...
1
by: John G | last post by:
I have created an ActiveX control that does word automation. Once I creat an instance of work I get the following message System.Security.SecurityException: That assembly does not allow partially...
1
by: nish85 | last post by:
Hi, i have uploaded my sit to web server goddady.com i have a button to download dyanmically generated excel file.This button is ajax enabled.....When i am click on this button it will popup a...
3
by: Joris van Lier | last post by:
I'm running an ASP.NET 2.0 web application in a Medium Trust environment, the application uses ODBC to connecto to MySQL and the hosting company has granted OdbcPermission, the solution includes a...
0
by: John G | last post by:
I tried creating a app with Silverlight. The app works great when I run it in vs.net 2008. But when I publish the app I get the following error: Assembly does not allow partially trusted callers ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.