2017-04-12 8 views
0

저는 vb.net을 처음 사용합니다 .. 우리는 최근 IBM iSeries Server에 연결 한 후 목록을로드하는 양식을 만들었습니다. 양식은 Win8에서 의도 한대로 작동하며 XP와 함께 작동하는지 확인합니다. 파일을 컴파일하고 .exe를 특정 폴더로 가져 와서이 폴더 (예 : C : \ My Programs \ VB_Apps)에서 앱을 실행합니다. 컴파일하는 동안 나는 any_cpu/x86/x64 옵션을 사용했고 같은 문제가있었습니다. 응용 프로그램이 ODBC 드라이버 (OleDB 드라이버를 사용해도 동일한 문제가 있음)를 사용하는 연결을 만들고 있습니다. 앱이 iSeries 서에서 호출되면 창이 하중을 받고 있지만, 연결시 앱이 중지되고 다음과 같은 메시지를 받고 :windows7에서로드 할 때 ODBC에서 VB.NET 양식 문제가 발생합니다. net framework 폴더에 대한 액세스가 거부되었습니다.

************** Exception Text ************** 
System.TypeInitializationException: The type initializer for 'System.Transactions.Diagnostics.DiagnosticTrace' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Access to the path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config' is denied. (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config) ---> System.UnauthorizedAccessException: Access to the path 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config' is denied. 
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) 
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) 
    at System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) 
    at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) 
    at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) 
    at System.Configuration.ClientConfigurationHost.OpenStreamForRead(String streamName) 
    at System.Configuration.BaseConfigurationRecord.InitConfigFromFile() 
    --- End of inner exception stack trace --- 

    at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) 
    at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) 
    at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() 
    at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) 
    --- End of inner exception stack trace --- 

    at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) 
    at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName) 
    at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) 
    at System.Configuration.ConfigurationManager.GetSection(String sectionName) 
    at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName) 
    at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection() 
    at System.Diagnostics.DiagnosticsConfiguration.Initialize() 
    at System.Diagnostics.DiagnosticsConfiguration.get_Sources() 
    at System.Diagnostics.TraceSource.Initialize() 
    at System.Diagnostics.TraceSource.get_Switch() 
    at System.Transactions.Diagnostics.DiagnosticTrace..cctor() 
    --- End of inner exception stack trace --- 

    at System.Transactions.Transaction.get_Current() 
    at System.Data.Common.ADP.IsSysTxEqualSysEsTransaction() 
    at System.Data.Common.ADP.NeedManualEnlistment() 
    at System.Data.Odbc.OdbcConnection.Open() 
    at app1.Form1.SQLAS_header() 
    at app1.Form1.Form1_Load(Object sender, EventArgs e) 
    at System.EventHandler.Invoke(Object sender, EventArgs e) 
    at System.Windows.Forms.Form.OnLoad(EventArgs e) 
    at System.Windows.Forms.Form.OnCreateControl() 
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 
    at System.Windows.Forms.Control.CreateControl() 
    at System.Windows.Forms.Control.WmShowWindow(Message& m) 
    at System.Windows.Forms.Control.WndProc(Message& m) 
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m) 
    at System.Windows.Forms.Form.WmShowWindow(Message& m) 
    at System.Windows.Forms.Form.WndProc(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam).` 

이 오류는 모두 64 & 86 시스템에서 발생합니다. 오류를 가져 오는 기계의 유일한 공통적 인 특징은 모두 win7을 사용한다는 것입니다.

이전에 비슷한 것을 경험 한 사람이 있습니까? 아니면 내가 잘못했을 수도 있습니다.

+1

충돌하는 코드 행을 게시하십시오. – SSS

+0

엑셀이 iseries에 연결할 수 있는지 확인한 다음 Excel 프로그램과 동일한 방법으로 VB 프로그램을 연결하십시오. – danny117

답변

0

사용자가 실행중인 응용 프로그램이 경로에 대한 액세스 권한을 갖고 있는지 확인해보십시오.

C : \ WINDOWS \ Microsoft.NET 프레임 워크 \ \ v4.0.30319 \ 구성 \ machine.config에 사용자에

권한 할당.

0

사용자는 persmisions를 가지고 있는데, 클라이언트가 현재 드라이버를 odbc에서 iseries odbc로 변경하면 win7 x64가 작동한다는 것을 깨달은 또 다른 사실이 있습니다. win7 x32를 사용하는 모든 컴퓨터는 여전히 작동하지 않습니다. win7을 win8 또는 그 이상으로 대체해야한다고 생각하지만 여전히 프로덕션 환경에서 내 앱을 신뢰할 수있는 솔루션이 없기 때문에 걱정 스럽습니다.

지금까지 감사드립니다.