0
Answer

cannot run a wpf file with linq to sql

pavi thra

pavi thra

15y
2.2k
1
hello there,, I'm just going mad with this problem.. I'm trying to run a wpf application which uses a linq to sql to fill a list box when a button is clicked... when i run the program i get the following biggg message... Startup URI: E:\sample_works\WpfBrowserApplication2\WpfBrowserApplication2\bin\Debug\WpfBrowserApplication2.xbap Application Identity: file:///E:/sample_works/WpfBrowserApplication2/WpfBrowserApplication2/bin/Debug/WpfBrowserApplication2.xbap#WpfBrowserApplication2.xbap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bd8627184188ac41, processorArchitecture=msil/WpfBrowserApplication2.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bd8627184188ac41, processorArchitecture=msil, type=win32 System.Windows.Markup.XamlParseException: Cannot create instance of 'Page1' defined in assembly 'WpfBrowserApplication2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'Page1.xaml' Line 1 Position 7. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: Request failed. at WpfBrowserApplication2.Page1..ctor() The action that failed was: Demand The type of the first permission that failed was: System.Security.PermissionSet The demand was for: The granted set of the failing assembly was: --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) --- End of inner exception stack trace --- at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId) at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc) at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.StartDispatcherInBrowser(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) ----------------------- PresentationHost.exe v3.0.6920.1427 built by: SP - C:\WINDOWS\system32\PresentationHost.exe ntdll.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\ntdll.dll kernel32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\kernel32.dll SYSFER.DLL v11.0.3001.2189 - C:\WINDOWS\SYSTEM32\SYSFER.DLL ADVAPI32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\ADVAPI32.dll RPCRT4.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\RPCRT4.dll MSVCR80.dll v8.00.50727.3053 - C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.3053_x-ww_b80fa8ca\MSVCR80.dll msvcrt.dll v7.0.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\msvcrt.dll USER32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\USER32.dll GDI32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\GDI32.dll ole32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\ole32.dll mscoree.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\system32\mscoree.dll SHLWAPI.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\SHLWAPI.dll urlmon.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\urlmon.dll VERSION.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\VERSION.dll SHELL32.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\SHELL32.dll WININET.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\WININET.dll CRYPT32.dll v5.131.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\CRYPT32.dll MSASN1.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\MSASN1.dll OLEAUT32.dll v5.1.2600.2180 - C:\WINDOWS\system32\OLEAUT32.dll comctl32.dll v6.0 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll uxtheme.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\uxtheme.dll CLBCATQ.DLL v2001.12.4414.258 - C:\WINDOWS\system32\CLBCATQ.DLL COMRes.dll v2001.12.4414.258 - C:\WINDOWS\system32\COMRes.dll xpsp2res.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\xpsp2res.dll netapi32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\netapi32.dll SETUPAPI.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\SETUPAPI.dll Apphelp.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\Apphelp.dll Secur32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\Secur32.dll dfshim.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\system32\dfshim.dll mscorwks.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll PresentationHostDLL.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\Microsoft.NET\Framework\v3.0\WPF\PresentationHostDLL.dll PSAPI.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\PSAPI.DLL actxprxy.dll v6.00.2900.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\actxprxy.dll SXS.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\SXS.DLL PresentationHostProxy.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\system32\PresentationHostProxy.dll mscorlib.ni.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\9adb89fa22fd5b4ce433b5aca7fb1b07\mscorlib.ni.dll System.ni.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\aa7926460a336408c8041330ad90929d\System.ni.dll WindowsBase.ni.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\WindowsBase\df20e56b59b1b1a595af305ddc0777ba\WindowsBase.ni.dll PresentationCore.ni.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationCore\12dcb10b76012416357bdbb010fdaa97\PresentationCore.ni.dll PresentationFramework.ni.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationFramewo#\9519494798a88867406b5755e1dbded6\PresentationFramework.ni.dll wpfgfx_v0300.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\Microsoft.NET\Framework\v3.0\WPF\wpfgfx_v0300.dll System.Xml.ni.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Xml\36f3953f24d4f0b767bf172331ad6f3e\System.Xml.ni.dll System.Drawing.ni.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\6978f2e90f13bc720d57fa6895c911e2\System.Drawing.ni.dll System.Windows.Forms.ni.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\9a254c455892c02355ab0ab0f0727c5b\System.Windows.Forms.ni.dll System.Security.ni.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Security\0418eb6dbffe9b46aa4c989153d6a3b5\System.Security.ni.dll rsaenh.dll v5.1.2600.2161 (xpsp.040706-1629) - C:\WINDOWS\system32\rsaenh.dll cryptnet.dll v5.131.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\cryptnet.dll WLDAP32.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\WLDAP32.dll WINHTTP.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\WINHTTP.dll SensApi.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\SensApi.dll USERENV.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\USERENV.dll WS2_32.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\WS2_32.DLL WS2HELP.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\WS2HELP.dll mswsock.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\mswsock.dll hnetcfg.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\hnetcfg.dll wshtcpip.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\System32\wshtcpip.dll NTDSAPI.DLL v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\NTDSAPI.DLL DNSAPI.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\DNSAPI.dll msv1_0.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\msv1_0.dll iphlpapi.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\iphlpapi.dll Cabinet.dll v5.1.2600.2180 (xpsp_sp2_rtm.040803-2158) - C:\WINDOWS\system32\Cabinet.dll mscorjit.dll v2.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll PresentationUI.ni.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationUI\87fb973e4ab6a21fd00e45656fa7c115\PresentationUI.ni.dll PresentationFramework.Luna.ni.dll v3.0.6920.1427 built by: SP - C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\PresentationFramewo#\b4dc4bd8534d90fbb7430926ad990cd9\PresentationFramework.Luna.ni.dll diasymreader.dll v8.0.50727.3053 (netfxsp.050727-3000) - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll Can anybody help me out.. PLEASE... with lots of thanks, Pavithra