Can't use WPF designer in VS2008 SP1 - xaml

i searched several hours four solution and nothing found. If I open WPF Designer in my VS2008 Team Suite SP1 I become following error:
Loading this assembly would produce a
different grant set from other
instances. (Exception from HRESULT:
0x80131401) 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.RuntimeType.CreateInstanceImpl(BindingFlags
bindingAttr, Binder binder, Object[]
args, CultureInfo culture, Object[]
activationAttributes) at
System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo
culture, Object[]
activationAttributes) at
System.Activator.CreateInstance(String
assemblyName, String typeName, Boolean
ignoreCase, BindingFlags bindingAttr,
Binder binder, Object[] args,
CultureInfo culture, Object[]
activationAttributes, Evidence
securityInfo, StackCrawlMark&
stackMark) at
System.Activator.CreateInstance(String
assemblyName, String typeName) at
System.AppDomain.CreateInstance(String
assemblyName, String typeName) at
System.AppDomain.CreateInstanceAndUnwrap(String
assemblyName, String typeName) at
System.AppDomain.CreateInstanceAndUnwrap(String
assemblyName, String typeName) at
MS.Internal.Package.VSIsolationProviderService.CreateIsolationProvider(String
identity, AssemblyReferenceProvider
assemblyReferences, IEnumerable`1
assemblyFolders) at
MS.Internal.Providers.VSDesignerContext.GetIsolationProvider(IServiceProvider
provider, IVsHierarchy hierarchy,
AssemblyReferenceProvider
assemblyReferences, Boolean
isSilverlightProject) at
MS.Internal.Providers.VSDesignerContext.GetIsolationProvider(IServiceProvider
provider, IVsHierarchy hierarchy,
AssemblyReferenceProvider
assemblyReferences) at
MS.Internal.Providers.VSDesignerContext.Initialize(IServiceProvider
provider, IVsHierarchy hierarchy,
UInt32 itemid, Object docDataObj)
at
MS.Internal.Providers.VSDesignerContext..ctor(IServiceProvider
provider, IVsWindowFrame frame, Object
docDataObj) at
MS.Internal.Providers.VSDesignerContext.GetContext(IServiceProvider
services, IVsWindowFrame frame,
Boolean createIfNotExist) at
MS.Internal.Designer.DesignerPane.InitializeDesigner()
What I tried to this moment:
Reset all settings in Visual Studio
Closed any open XAML files in project, closed Visual Studio, re-opened VS, opened XAML file
Create new user in operating system and try open solution with them
Completed uninstallation/reinstallation of VS 2008 SP1 + MSDN, .NET 3.5 Framework SP1, Silverlight SDK, WPF Toolkit - January 2009
I run on Windows Vista SP1 32bit Business Edition.
Do any have a idea how can I solve it before I would try reinstalling operation system?
Regards
Anton Kalcik
UPDATE: Also I tried to disable all add-ons.

First of all not only you receive this error so may be you should google it first? As you can see there are many behaviors of this problem and we are not able to figure out what is wrong in your case because it's hard to reproduce the problem. Also you may try to repair you VS or disable all your addins

Thanks for explaining what attempts failed. Saves me the hours and false hope.
Have you tried reinstalling VS without SP1? (You bet it's SP1's fault, this never happened before I updated VS)
Also your designer doesn't work on ANY project right? Even new ones? And in other prog languages too?

Related

Could not load file or assembly 'Microsoft.AspNet.Security.DataProtection'

When upgrading to the latest versions of the asp.net-5 stack, I encountered the following stack trace while attempting to access my SignalR hub.
FileNotFoundException: Could not load file or assembly 'Microsoft.AspNet.Security.DataProtection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
System.Type.GetType(String typeName, Boolean throwOnError)
Microsoft.AspNet.DataProtection.KeyManagement.XmlKeyManager.ParseKeyElement(XElement keyElement)
Microsoft.AspNet.DataProtection.KeyManagement.XmlKeyManager.GetAllKeys()
Microsoft.AspNet.DataProtection.KeyManagement.KeyRingProvider.CreateCachedKeyRingInstanceUnderLock(DateTime utcNow, CachedKeyRing existingCachedKeyRing)
Microsoft.AspNet.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRing()
Microsoft.AspNet.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] unprotectedData)
Microsoft.AspNet.SignalR.Infrastructure.DataProtectionProviderProtectedData.Protect(String data, String purpose)
I understand that this assembly has been renamed Microsoft.AspNet.DataProtection and I see from the aspnet github repositories that this change SEEMS to have rippled through the other projects.
I have deleted all references to the old assembly, searched the ENTIRE contents of the .k directory, my project directory, my GAC, EVERYTHING.
Of course, after 4 hours of trying to figure this out, I discover the bizarre cause of it right after I post the question:
The reason why scouring my entire hard drive for any possible mention of the old assembly turned up nothing is because the reference to it was cleverly ENCRYPTED in an XML file in my %APPDATA% directory created by the old version of the assembly!
When upgrading to the new version with the new assembly name, you MUST delete the contents of the directory: %APPDATA%\Local\ASP.NET\keys-BETA or you will end up with this error! The xml file in this directory contains an encrypted representation of the assembly-qualified classname of the decryptor, which will be using the old "Security.DataProtection" assembly instead of the new one.
Similar to Avi Cherry, I found I had this problem moving from .NET Core (DNX) RC1 to (DotNet) RC2.
The directory I needed to delete was %localappdata%\ASP.NET\DataProtection-Keys.
The xml inside referenced Microsoft.AspNet.Security.DataProtection, which was should have been Microsoft.AspNetCore.... Instead of trying to change it, I just removed the directory.
I can't comment on the other answers, so need to add my own.
As others have said you need to delete the CONTENTS of the
%localappdata%\ASP.NET\DataProtection-Keys
directory.
But do NOT delete the entire folder. This can cause issues for dotnetcore apps later. Visual Studio may say "debugging is starting" and just hang.

SSIS to SSRS communication issue

I have an SSIS package that retrieves a days worth of information from a data warehouse into a table in SQL Server and then exports that data to a flat file.
The package then generates a PDF report from the same data that was exported.
In order to export the PDF file, the report had to be created in SSRS and published to a URL the SSIS package could get to.
The package contains three connection managers, one to SQL Server, one to the Flat File and one to SSRS via an HTTP Connection Manager.
The HTTP Connection Manager allows me to create a connection to my SSRS instance and there is a button on that dialog that allows you to test the connection.
The connection tests correctly and I receive a success message.
I have done this exact thing in numerous other environments and it works correctly.
Some things to be aware of are, I created this package on another machine and copied it to numerous environments. Because of this, I use a configuration file to store many of the settings the package uses, file paths, login credentials and other things.
I also made sure that the connection settings were correct and that I could browse to the Report Server and view the report I am trying to download in SSIS.
When I execute the package, I receive the following error message from the package:
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: Exception from HRESULT: 0xC001600E ---> System.Runtime.InteropServices.COMException (0xC001600E): Exception from HRESULT: 0xC001600E
at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSHttpClientConnection100.DownloadFile(String FileName, Boolean vbOverwriteDestination)
at Microsoft.SqlServer.Dts.Runtime.HttpClientConnection.DownloadFile(String fileName, Boolean OverwriteDestination)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Dts.Runtime.HttpClientConnection.DownloadFile(String fileName, Boolean OverwriteDestination)
at ST_6b197a6290df4aff91a6881078049a14.csproj.ScriptMain.Main()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
That's about all I can think of that would be useful, but if you have any questions, I'll be monitoring this thread for a couple of hours.
Thanks.

visual studio 2010 not showing errors anymore

I have not used my Visual Studio 2010 for 2 weeks. Did not even touch my computer and now I am trying to work on a project.
Loaded in the project and none of the errors are shown (not even in the errorlist window). When I click build it says: build succeeded (but a bit too fast for my saying). I have tried to reload the references and even created a new project and copied the code in to it. None of this works. If I then run the project I get current error:
A first chance exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll
System.MissingMemberException: Der öffentliche Member Domains für den Typ Iref wurde nicht gefunden.
bei Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
bei Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
bei myprogram.myfunction() in projectpath/myprogram.vb:Line 132.
Iref is a reference and I am 100 procent sure that the Domains member still exists in this reference.
Anyone have any ideas how I can fix this?
Fixed this by putting on the Option Strict to ON.
Not really the best solution but will do for the meanwhile
I encountered the same problem. I solved this by changing the Active Solution Platform to Mixed Platform. To do so, go to Configuration Manager and set the Active Solution Platform in the upper right corner.

Exception "Could not load file or assembly 'Messages' or one of its dependencies." NServiceBus

I am just trying to run a simple NServiceBus Pub/Sub example. Basically, I have pub/sub as console apps and when i run them I am getting an exception on sub side.
Exception was unhandled by user code
Message=Exception when starting endpoint, error has been logged. Reason: Error creating object with name 'NServiceBus.Unicast.UnicastBus' : Error setting property values: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are:
[Spring.Core.TypeMismatchException: Cannot convert property value of type [System.Collections.Hashtable] to required type [System.Collections.IDictionary] for property 'MessageOwners'., Inner Exception: System.ArgumentException: Problem loading message assembly: Messages ---> System.IO.FileNotFoundException: Could not load file or assembly 'Messages' or one of its dependencies. The system cannot find the file specified.
File name: 'Messages'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at NServiceBus.Unicast.UnicastBus.ConfigureMessageOwners(IDictionary owners) in d:\BuildAgent-02\work\20b5f701adefe8f8\src\unicast\NServiceBus.Unicast\UnicastBus.cs:line 1204
Looks like I am missing assembly called "Messages", but I am not sure where I could find it.
Thanks.
It's most likely that you have "Messages" specified in the UnicastBusConfig (maybe left over from copying the config from one of the samples).
I'm not exactly what the issue is, HOWEVER, you must make sure that your Message Types are in a separate assembly, and that your Message classes Implement the NServiceBus IMessage Interface.
Also, both your Pub and Sub need to reference your Messages assembly (which you can call anything obviously, you don't have to call it Messages).

EF 4, POCO Template - getting error on splitting across namespaces

I am following the steps as outlined on MSDN Blogs > ADO.NET team blog > Walkthrough: POCO Template for the Entity Framework.
I created a simple model in the Keith.Data Project (and Namespace). I created a Keith.Model Project and added it to the solution, dropped the Class.cs file, dragged and dropped the DataEntities.tt file into the Keith.Model project and added a reference to Keith.Model in my Keith.Data project. I then changed the path reference in the DataEntities.tt file from #"DataModel.edmx" to #"..\Keith.Data\DataModel.edmx". When I saved it I got this error:
Running transformation: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Unable to locate file
at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolvePath(String path)
at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolvePath(String path)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.VisualStudio.TextTemplating6A60439B68BD2BCE671B842FB15E35C4.GeneratedTextTransformation.DynamicHost.ResolvePath(String path)
at Microsoft.VisualStudio.TextTemplating6A60439B68BD2BCE671B842FB15E35C4.GeneratedTextTransformation.MetadataLoader.TryCreateEdmItemCollection(String sourcePath, String[] referenceSchemas, EdmItemCollection& edmItemCollection)
at Microsoft.VisualStudio.TextTemplating6A60439B68BD2BCE671B842FB15E35C4.GeneratedTextTransformation.MetadataLoader.CreateEdmItemCollection(String sourcePath, String[] referenceSchemas)
at Microsoft.VisualStudio.TextTemplating6A60439B68BD2BCE671B842FB15E35C4.GeneratedTextTransformation.TransformText()
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)
Anyone run into this and know what the problem is? I am sure I missed something but for the life of me I cannot figure out what.
TIA
I replicated the scenario you mentioned and got the same error when the Path to the .edmx file in POCO.tt (DataEntities.tt in your scenario) was wrong. Double check if the path you have specified is correct.
I use EF4/POCO but have all my entitites defined in code not an edmx so I'm not an expert in the approach you're using...
That said, a simple way to identify what the app is doing: download the sysinternals Proces Monitor and point it at VS - then have a look at what files it's trying to access (filter on DataModel.edmx). This will at least tell you where it's expecting the file to be - it's possible your relative path is incorrect.
I'm sure other devs with more experience in this topic can give you a better answer but this is how I'd approach solving it...