Windows Work flow assemblies not picking up - visual-studio-2012

We we trying to create a work flow dll using Windows Work Flow but we are running into major problems regarding referencing.
1.) We have a class that calls an activity but the class cannot pick up the activity that has already been created
WorkflowAcivity workflowActivity = new WorkflowActivity(string id)
This then throws an error message saying cannot find WorkflowActivity
2.) We then added extra assemblies, like one of our other dll's, Visual Studio also cant find these references when we call a class in those dll's we are referencing.
3.) Intellisence has also stopped working??
What do we do to fix this, is it the version we are using or are there any other assemblies we are missing here??
We have tried opeing the solution on another pc, uninstalled vs 2012 and installed vs 2013 and still have no luck!

Got caused by System.Net.Http.Primitives.dll referencing some dll's that were missing and caused the workflow to break without any warnings.
Removing this dll or adding the referenced dlls back in (System.Runtime.dll and System.Runtime.InteropServices.dll) fixed the problem.
Microsoft ticket for this.

Related

I'm despairing of using Interop.Excel in Visual Studio 2022 - the library can't be loaded

I've tried everything - I swear...
But now I am running out of ideas and need some expert help.
I've already been using Microsoft.Office.Interop.Excel in the past.
But now, something seems to have changed.
Whatever I am trying, I can't get rid of that dll-error:
System.InvalidCastException:
'Unable to cast COM object of type 'Microsoft.Office.Interop.Excel.ApplicationClass'
to interface type 'Microsoft.Office.Interop.Excel._Application'.
This operation failed because the QueryInterface call on the COM component for the
interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error:
Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).'
MY ENVIRONMENT:
My VS version:
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.4.4
Interop.Excel version and path:
Microsoft Excel 16.0 Object Library
C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Office.Interop.Excel\15.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll
Office:
I am using Office 365.
1. started from scratch
To exclude everything else, I've set up a completely new project with nothing in there apart from the using-directive. And... I get the same error (see screenshot: https://i.stack.imgur.com/ZZHFN.png).
2. added reference in different ways
I've added the reference from the COM list, but also tried to directly use the path - no difference.
checked the file location and version
The file is exactly where it should be.
I can't see any newer version of the DLL for download either.
updated to the latest .NET version
Nothing changed.
Do you have an idea how I could solve this error?
(Please be gracious with your answer - I had a few years programming break and am just starting up again...)
Have a good day!
Katrin
I don't have an off-the-shelf solution for this, but any problem in VS 2022 related to COM interop reeks of 32/64-bit issues. Here are some thoughts:
Are you using 32-bit office? Check: File => Account => About Excel, and see what it says in bold font at the top.
Are you building for AnyCpu, or are you targeting a specific architecture (x86/x64)?
You could also check the registry to see if your assembly is actually registered for the correct "bitness", i.e. the one matching Excel.
VS2022 defaults to 64-bit if you're building AnyCpu, as opposed to earlier (32-bit) versions of VS.
/Einar
Meanwhile, I switched to the NuGet package "ClosedXML", which works fine. This should work for others with the same problem too.
Hint: Before installing, check the hints on the ClosedXml Website. The installation doesn't work the usual way (FEB-23), but there's an easy solution.

Project is targeting frameworks not installed or are included as part of future updates to Visual Studio

I am attempting to convert the Microsoft.Health C# class library that is installed as part of the HealthVault SDK, using instructions provided here. After following these instructions, I get the following error when attempting to load the project into Visual Studio 2013.
"The project is targeting frameworks hat are either not installed or
are included as part of future updates to Visual Studio. See
http://go.microsoft.com/fwlink/?LinkId=287985"
Visiting the link takes me to .NET SDKs and Downloads. Once there, I have no clue on what needs to be done.
I do realize that one will have to leverage the Portable Class Library Contrib project to fill in some missing bits, especially code related to System.Security. This, I will deal with later.
Any one run into a similar problem?
Maybe so late but for those who have the same problem.
I had the same error in a project which was working perfect before updating VS2013 and finally after 3 hours looking for the source of the error I found that the error is about TargetFrameworkProfile.
In my case I sloved it like so:
Right click in the unloaded project in your solution and click Edit.
Find the TargetFrameworkProfile tag and set it as below:
<TargetFrameworkProfile>Profile78</TargetFrameworkProfile>
At a guess, this is because you need to specify the TargetFrameworkVersion and TargetFrameworkProfile properties in the project file. Compare the .csproj you are trying to create to a newly created PCL project file, and make sure that everything that's not specific to your project matches.
I ran into the same issue and got it resolved by installing the latest Visual Studio Update

"Object reference not set to an instance of an object" when building my cloud project

When I build my solution with a bunch of cloud projects, I see one or more "Error: Object reference not set to an instance of an object" messages in the output. When I try to run one of the cloud projects, I get the popup "There were build errors. Do you want to continue and run the last successful build", but there are no errors in the Error List and the same "Error: Object ref..." errors in the output.
When I click package on my cloud project I get a messagebox with "Object reference not set to an instance of an object", also when I right click -> properties on the project reference under "Roles" in the cloud project.
If I use the command line to build my solution with msbuild, I don't get the error.
I tried restarting Visual Studio as well as my PC. I also tried reinstalling Azure Tools (2.1) and then Visual Studio.
My colleague is now getting the same problem on Visual Studio 2013 RC.
Has anyone had the same problem?
I've searched, but only found people with problems when publishing, where the solution is to package manually.
I had the same problem. Right click on the cloud service project, unload the project. Reload it again.
Try removing the role from the cloud project, re-build solution (if there are errors please post them), then add the role back into the cloud project and re-build.
I had a similar issue when a publish exited out and I started receiving the 'Object not found' error. VS2013 (in my case) was reporting that 'diagnostics.wadcfg' was missing and had unusually stored this into a different directory.
By going into the project file (.ccproj) and removing the erroneous entry from the 'Project\ItemGroup\Content Include "\diagnostics.wadcfg" and reloading the project - everything kicked back into life.
Failing that, check a working project file against the offending project file for inconsistencies.
You don't have to remove your roles and add them back in again, which is really annoying because you have to preserve the contents of your cscfg and csdef files. Instead, close Visual Studio, delete the solution's .suo file and open the solution back up again.
I wanted to let everyone know I was dealing with a very similar situation, albeit with a different version of the Azure SDK (1.8). I have many projects with Cloud Services that I have created built numerous times and then all of sudden could no longer open them. Attempting to open the Cloud Service configuration UI resulted in the “Object not set to a reference” error. I could open the actual XML file, but not the GUI interface.
I attempted to reinstall the 1.8 SDK and tools numerous times, as well as VS 2012 to no avail. I finally tried installing the latest SDK (2.2) and now I can open the projects. Not sure what changed in my system prior to this but glad I was finally able to open my projects again!
I also had this error when building. Projects within the solution would build independently but building the entire solution failed.
I have learnt usually these types of issues are caused by invalid azure role or configuration files. In my case it turns out a .cscfg config file rename on another branch was merged with my branch but it didn't rename the file – therefore the .ccproj file in my branch was incorrectly referring to the new name but only the old filename existing in the solution. After manually editing the .ccproj with the new filename I closed/reopened the solution and things started working.
I had a similar issue with VS2013 express after creating a view in my MVC project.
I reverted the project with git, but this did not solve the issue. I also checked the project out to a different location on my pc, but this did not solve the issue. I was able to check the project out on my laptop without seeing this issue.
In the end, I undinstalled VS2013 express and all of it's counterparts and re-installed. This solved the issue.
I had this bug (but not using a cloud project). Turns out the character encoding that Perforce (P4V) was using was wrong, it should have been UTF-8. After changing to UTF-8 and re-syncing the code, Visual Studio was able to find and compile the project just fine.
Maybe a hint: I got the same error message, when compiling VS2013 Dot42 project - realized it was caused by assigning concrete value of some inner type (in my case Enum) to INullable variable:
private SomeClass.SomeEnum? _var1;
...
_var1 = SomeClass.SomeEnum.XY; // causes compilation error
The solution was, not to use INullable:
private SomeClass.SomeEnum _var1;
None of these answer helped me. I decided to reinstall the Azure tools, and noticed that I had more than one version installed. I uninstalled the old versions, reinstalled the latest version, and this fixed it for me.
I got the same message while publishing our project too, though in Visual Studio 2010.
For me, deleting all the files from bin folder worked.

F# compilation errors in Azure only when deployed from GitHub

I'm deploying a C# website to Azure from a GitHub repository. This website references a couple of F# libraries and they compile just fine on my machine, but in Azure the build fails with a number of compilation errors.
Here is a snippet of the build log:
FS0001: A generic construct requires that the type 'Company' have a public default constructor [C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\Services.fsproj]
C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\CompaniesService.fs(28,17): error FS0039: The field, constructor or member 'PopulateWith' is not defined [C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\Services.fsproj]
C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\AppHost.fs(17,55): error FS0072: Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. [C:\DWASFiles\Sites\eureka-servicestack-poc\VirtualDirectory0\site\repository\Eureka.ServiceStack.FSharp.Poc\Services\Services.fsproj]
An error has occurred during web site deployment.
The first error should have been fixed after I put the CLIMutable attribute on the offending record type and the second error should have been fixed after including the proper namespace. I don't know what exactly the third error is about, especially since none of them happen locally.
To make sure I had the same version of F# in both places I've included the FSharp.Core dll in the solution and refer to the local version. This did not help but it removed a warning that it could not find version 4.3.1 of the file.
Is it possible that I'm running another version of the F# compiler and how do I check that? It has worked fine until now, which makes me suspect some slight difference in versioning of something. Unfortunately it seems quite hard to get insight into what actually happens in the build environment. It is a free website Azure website and it does not seem like you cen get direct access to it.
I could probably work around the individual issues for now but there seems to be a deeper issue at work here.
This turned out to be an issue with different versions of the F# compiler being used. Using Visual Studio 2013 RC, I was using the 3.1 version, which has had some improvements causing my specific issues to not appear.
The problem was made difficult to identify because changing my F# project to use the 3.0 compiler in Visual Studio did not have any effect (it still compiled just fine). I even opened the solution up in Visual Studio 2012, and it all compiled well enough. It was only when I created a new project from scratch in VS 2012 that I began to get the same compilation errors as on the server. So I guess that this must be an error (or at least not very desirable feature) in the project file that was created. I'm not sure if this should be classified as a bug with VS 2013, especially since I don't know exactly what causes the error.
So the simple solution until Azure (or is this a Kudu thing?) supports the 3.1 compiler is to either recreate the project file in VS 2012 or to copy code which does not compile over to a test solution where fixes can be tested.

Visual Studio 11 complains about one namespace import in web.config

I have a .NET 4.0 web site which was coded in Visual Studio 2010.
I installed the VS11 beta last night, and am using that to work on the web site today. I did NOT change the web site to be .NET 4.5, it is still 4.0.
I have a number of custom libraries which I've written, and use in most of my projects (db access, LINQ extensions, etc.). I have them all <system.web><pages><namespaces><add/>ed in the web.config of my project so that I don't need to put an Import line at the top of every file where I want to use things from them.
This all works fine and as expected in VS2010, and in VS11 it all works fine, ... EXCEPT for one single exception. ONE and ONLY one of my custom libraries, when I have it included in the web.config, the design-time compiler outputs an error message to the Error List window stating:
Error: The namespace 'MyLibraries.LIB' is not a valid identifier.
All my other libraries continue to work fine, just as they did in VS2010. I thought maybe there was an invisible character embedded in the file or something, so took out the whole <add/> line for that namespace and retyped it from scratch. No joy. I've also tried removing the DLL (and associated files) from the bin directory and re-adding them, also with no change.
Turns out this wasn't so much a problem with VS11 itself, but with the Framework 4.5.
I uninstalled VS11 and VS2010 still had the same problem.
I then saw that uninsting VS11 did NOT uninstall .NET 4.5, so I uninstalled that, and then 2010 was good.

Resources