SAP Connector Configuration - "Test Connection" in Anypoint Studio fails, but works when deployed - anypoint-studio

I'm trying to develop an application with Anypoint Studio and SAP. I imported the SAP connector from Mulesoft Exchange, added the correct SAP libraries (I added them as described by mulesoft --> 'add maven dependency' --> 'install' --> select the local File and change the version to the correct number. All red crosses became green checkmarks.) and entered my SAP server credentials. When I try the "Test Connection" button I get an error message:
The confusing part of this is, I can run the application and it deploys without a problem
I already downloaded and unzipped a 'new' anypoint studio, I tried multiple versions of JDK (1.8u201 [this one works without problems for my colleague], 1.8u241 and OpenJDK 8 LTS), I restarted my pc every time I changed my JDK, I tried to add the native JCo Library locally to the build path (checkmark becomes also green, but still the same error message + a lot of 'Building worksapce' errors) and tried to add all libraries to the local build path.
What could I do to get rid of this error message?

Ok. I found the solution to my problem.
I did everything in a correct way, but I extracted Anypoint Studio in my downloads folder and didn't change anything of the resulting path. So the path was very long and in combination with the libraries the path became too long and they could not be initialized.
So if you get this error try to move the Anypoint Studio folder/Anypoint Studio worksapce/folder where you store the libraries to your root folder (or at least try to keep the path short by changing the folder names).

Related

System could not be found Visual Studio 2017 ASP.NET Core project

I've installed the newly released version of Visual Studio 2017 and started a fresh ASP.NET Core project targeting .NET Core.
Out of the box, I'm getting the
The type or namespace name 'System' could not be found (are you
missing a using directive or an assembly reference?)
error. Any idea what's causing this and how to fix it?
Also, looks like there are problems with NuGet packages as well:
I also tried dotnet restore on the project through the command line and got the following error:
P.S. Kind of disheartening that you get an error in a fresh new project in the latest version of Visual Studio 2017!
UPDATE:
SDK version is v 1.0.1 -- see below:
UPDATE 2:
This is very strange. Looks like the original problem was due to NuGet package source pointing to a folder under Visual Studio 2015 folder. I unchecked it and left only nuget.org. With that my project seemed to have restored all the packages and when I started the project it loads up the standard ASP.NET page. But if I open startup.cs file, I get red squigglies all over the place but if I run the project, it works fine. What's going on here?
UPDATE 3:
I closed the project and VS 2017. I then restarted VS 2017 and opened the project and now it seems to be fine. And I'm not referencing the .NETStandard library 1.6.1 and everything seems to be working fine now.
I had the same issue in my Visual studio 2017 .Net Core application. I closed the Visual studio and re-open fixed everything.
Came across the same issue today. I had an old nuget source that no longer existed. So I went into Tools > Nuget Packet Manager and un-checked the wrong one. Hit "Ok", and then rebuilt the project, and it works great now. It seems like you stumbled onto it, but also wanted to verify that it fixed my issue, and it does.
I had the same problem, first when converting a VS2015 net core mvc web project to 2017 and then when trying to create a new core web application in 2017.
Went to Tools|NuGet Package Manager|Package Manager Settings - checked 'Allow NuGet to download missing packages' and 'Automatically check for missing packages during build in VS' and then clicked 'Clear All NuGet Cache(s)'.
Then re-built the solution - it found and loaded all the required packages and ran OK.
May not work for all cases but simple and worth a try.
Multiple closing and reopening of VS2017 fixed it for me.
I had the same issue, the solution for me was to clear the NuGet cache. Tools > NuGet Package Manager > Package Manager Settings > Clear All NuGet Cache(s)
Check the version .NET Command Line Tools in CMD, just type dotnet --info. If version is 1.0.0, then try to install latest version .NET Core SDK from here.
Find the broken project and right click, Unload, right click, Re-load. Fastest fix for me.
If you get the problem while using the CLI, try doing nuget restore instead of dotnet restore as that sometimes pulls down packages that the dotnet CLI seems to miss.
I have had the same issue with Visual Studio 2019 and .NET Core SDK 2.2.
These steps solved the problem:
Close the Visual Studio
Open the Visual Studio as Administrator
Open the Solution
Right click on Solution -> Restore NuGet Packages
I've tried all answers above. For me works only removal and adding the reference again described in the following steps:
Open 'References' under the project.
Right click on 'System' reference.
Click on 'Remove'.
Right click on 'References'.
Click 'Add Reference...'.
From right menu choose an 'Assemblies',
In a search field type 'System'.
Choose 'System' from the list.
Click 'Add' button.
IMPORTANT: Restart the Visual Studio.
'System' reference you can replace with any you need.
Try adding the following line above the other references in the csproj file
<Reference Include="netstandard" />
For me the problem was caused by my project having a custom IntermediateOutputPath. For some reason, if project_name.csproj.nuget.g.targets is not in obj subfolder of project folder, the error occurs.
Using default IntermediateOutputPath or keeping a shadow copy of project_name.csproj.nuget.g.targets in fake obj folder solves the problem for me.
This issue seems to be triggered by a myriad of reasons. Mine was caused by cloning directly from VSTS using Git Bash, my project directory had spaces in it. Git Bash changed those spaces in the path to %20. It was throwing off all the references in my project. So for anyone who tried everything else and are at their wits end, make sure %20 is not in the path.
So, I have cloned the repository from github and started getting this error.
It was my project uploaded from another machine. I later realized that I have used the materialdesign packages in my project.
I have uninstalled and reinstalled these packages and it fixed my issue.
Had the same problem. Uninstalled Application Insights from my projects using the nuget package manager. I'm not looking at that yet, I just wanted core and unit tests. Problem solved.
I also had the same problem.
The is no SDK folder under the Dependencies one. Therefore, no Microsoft.NetCore.App libraries !
To solve this problem, in Nuget manager window, install any nuget which depends on .NetCoreApp (you can install for example Microsoft.AspNetCore or BundlerMinifier.Core from the Microsoft Visual Studio Offline Packages source).
The SDK will be restored by the same time.
Once it is back, you can uninstall the previously added nuget. The SDK will remain in place.
Not quite sure in which order vs 2017 trying to resolve packages.
But my situation was following. In my VS2015 I had configured local and 3rd party source for nuget packages, newly installed version of 2017 loaded them too.
https://api.nuget.org/v3/index.json was first in list.
But vs2017 throwed an error that it can't restore .net core libraries from my another local repo.
After I unchecked all of them except https://api.nuget.org/v3/index.json, it had started to working normally.
I had this problem too, but not right now, this steps solved my problem: Choose Project -> Properties from the menu bar. In the Project properties window, under Configuration Properties -> General, make sure that Common Language Runtime Support is set to Common Language Runtime Support (/clr)
Simply opening the NuGet package manager and then the Visual Studio settings related to it - without changing anything - merely looking around, and when I closed out, the problem was gone.
This seems to be an intermittent issue that can come and go for no obvious reason.
None of the answers here worked for me so I'm posting what did work.
My errors were mostly the same as the original poster but I also had:
Error loading meta data for 'Microsoft.Extensions.FileProviders.Embedded.2.0.1'
hexadecimal value 0x1C invalid character
Every time I attempted to download a different nuget package or restore old packages I would see this error. I also saw the other errors such as:
type or namespace system could not be found
What worked for me:
opened the filepath that the error said the bad metadata was in, which for me was C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.extensions.fileproviders.embedded\2.0.1
Then, I put the contents of that folder into another folder I named "hiding".
Then, I went back to the nuget package manager and tried to install a package, hoping to have the SDK restored. IOt worked successfully, and all my other errors were gone as well, and the fresh new project runs as it should!
The problem for me occurred when running my Visual Studio as Admin with a separate user-- I had created a Git Repo with the source files in the user documents of my normal account. When I created a new solution in that folder the above errors occurred. Try creating your project in a different place and see if the error still occurs.
I was facing the same issue when I created a new project (.net Core 2.2) in VS2019.In my case there was an Azure package which was creating the problem.I uninstalled it and the project started working fine.
Run mentioned below command to uninstall the package.
Uninstall-Package Microsoft.VisualStudio.Azure.Containers.Tools.Targets -Version 1.7.10
I had the same problem. I cloned a github project and this error came. So I deleted the cloned project and then I cloned the project again and it worked fine.

VB.Net build error targetting .Net 2 in VS2013 [duplicate]

My app keeps getting this error (I'm using VS 2013, VB.NET, and Windows 8.1, by the way):
Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86". Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files (x86)\MSBuild\12.0\bin\MSBuildTaskHost.exe" exists and can be run.
The app is for .NET 3.5 (3.5 and lower versions get me this error).
I try to run the app again. Sometimes, it works; sometimes, the error comes back.
I already tried looking up for answers at Google and the answer they gave me turned out to be: "Your build's username is too long" (they said that 20 characters or more cause the error), but it's not true. My user name is 5 characters only. Anyway, I don't think my build's username's length has anything to do with it; it makes no sense.
Does anyone know what is wrong with 3.5 and lower versions? Thank you.
This fixed the issue on my machine:
To resolve it, go to your csproj file and add the following line under the default property group:
<PropertyGroup>
...
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
</PropertyGroup>
Found here.
Clean and rebuild solution worked for me.
Adding this in each project is a cumbersome task. So you can set it in the environment variables.
Click Start>> Right-click Computer >> Properties >> Advanced system settings >> Click Environment Variables button to open the dialog, then under the System variables section, click New… button, type the Variable name = DISABLEOUTOFPROCTASKHOST, and type the Variable value = 1, then click Ok.
More here
I'm using VS 2013, VB.NET, and Windows 10, 64 bits, by the way
Just change in XML properites , Services : .NET Framework 4.6 instead .Net Framework 2.0 (Default)
and working fine for me.
I try adding the follow but didn't works
<PropertyGroup>
...
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
</PropertyGroup>
this solve this issue for me, adding the same as enviroment Variable
DisableOutOfProcTaskHost=true
I encountered this error when trying to build a sample solution that was included in some software that was installed under C:\Program Files\. Visual Studio prompted me to restart with elevated privileges (as it does when opening a solution in a "secure" location), however the build failed with the OP's error message.
Copying the solution to a "normal" folder (e.g. C:\Temp) solved it for me.
I tried opening an old VS2010 vb project inside VS2013 recently and just ran into this problem. I got around it this way:
I went to the vb project's properties page
I clicked the "Debug" tab
In the "Enable Debugers" section, I saw that the "(x) Enable the Visual Studio hosting process" checkbox was already checked.
I tried un-checking the "( ) Enable the Visual Studio hosting process" option
I saved these changes (Ctrl+S)
I then checked the "(x) Enable the Visual Studio hosting process" checkbox once more
I saved these changes (Ctrl+S)
My next re-build of the project was then successful.
Luckily, I was able to observe how the .vbproj file changed in my version control, and saw that it added the following line into it (which was not there before, despite the checkbox already being set initially):
<UseVSHostingProcess>true</UseVSHostingProcess>
None of the answers in this worked for me. I had to run Visual Studio as admin. Hope this helps someone in the future!
If you don't know how to run a program as admin on Windows, click this link.

"GenerateResource" task CLR2 runtime error

My app keeps getting this error (I'm using VS 2013, VB.NET, and Windows 8.1, by the way):
Could not run the "GenerateResource" task because MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86". Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files (x86)\MSBuild\12.0\bin\MSBuildTaskHost.exe" exists and can be run.
The app is for .NET 3.5 (3.5 and lower versions get me this error).
I try to run the app again. Sometimes, it works; sometimes, the error comes back.
I already tried looking up for answers at Google and the answer they gave me turned out to be: "Your build's username is too long" (they said that 20 characters or more cause the error), but it's not true. My user name is 5 characters only. Anyway, I don't think my build's username's length has anything to do with it; it makes no sense.
Does anyone know what is wrong with 3.5 and lower versions? Thank you.
This fixed the issue on my machine:
To resolve it, go to your csproj file and add the following line under the default property group:
<PropertyGroup>
...
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
</PropertyGroup>
Found here.
Clean and rebuild solution worked for me.
Adding this in each project is a cumbersome task. So you can set it in the environment variables.
Click Start>> Right-click Computer >> Properties >> Advanced system settings >> Click Environment Variables button to open the dialog, then under the System variables section, click New… button, type the Variable name = DISABLEOUTOFPROCTASKHOST, and type the Variable value = 1, then click Ok.
More here
I'm using VS 2013, VB.NET, and Windows 10, 64 bits, by the way
Just change in XML properites , Services : .NET Framework 4.6 instead .Net Framework 2.0 (Default)
and working fine for me.
I try adding the follow but didn't works
<PropertyGroup>
...
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
</PropertyGroup>
this solve this issue for me, adding the same as enviroment Variable
DisableOutOfProcTaskHost=true
I encountered this error when trying to build a sample solution that was included in some software that was installed under C:\Program Files\. Visual Studio prompted me to restart with elevated privileges (as it does when opening a solution in a "secure" location), however the build failed with the OP's error message.
Copying the solution to a "normal" folder (e.g. C:\Temp) solved it for me.
I tried opening an old VS2010 vb project inside VS2013 recently and just ran into this problem. I got around it this way:
I went to the vb project's properties page
I clicked the "Debug" tab
In the "Enable Debugers" section, I saw that the "(x) Enable the Visual Studio hosting process" checkbox was already checked.
I tried un-checking the "( ) Enable the Visual Studio hosting process" option
I saved these changes (Ctrl+S)
I then checked the "(x) Enable the Visual Studio hosting process" checkbox once more
I saved these changes (Ctrl+S)
My next re-build of the project was then successful.
Luckily, I was able to observe how the .vbproj file changed in my version control, and saw that it added the following line into it (which was not there before, despite the checkbox already being set initially):
<UseVSHostingProcess>true</UseVSHostingProcess>
None of the answers in this worked for me. I had to run Visual Studio as admin. Hope this helps someone in the future!
If you don't know how to run a program as admin on Windows, click this link.

Error while upgrading worklight project from V6.1 to V6.1.0.01

I am trying to upgrade worklight project built using v6.1 to v6.1.0.01 and getting following error :
An internal error occurred during: "Upgrade Worklight Projects".
com.worklight.upgrader.versionGraph.VersionGraph.isKnownVersion(Ljava/lang/String;)Z
The version of studio is 6.1.0.01-20140418-0637
This could happen if your imported project is missing
either the complete org.eclipse.core.resources.prefs file in the .settings folder of your project (this is hidden file; you can see it using the Navigator view in Eclipse for example),
or if this file exists but it is missing the wl_version property.
You can fix this by creating a new project and copy over this file to your 6.1.0.0 project and then try to upgrade again to 6.1.0.01 - which you should be using 6.1.0.02 anyway by now and not 6.1.0.01.
One workaround you can do is to create a new project with the same name, etc in the Studio belonging to 6.1.0.01 and copy over your web resources and native code to the newly generated files.
You can also take a blank app in 6.1.0.0 and try to import that one to 6.1.0.01 to see whether it fails still or not. This will help in focusing the issue.

Updating Mule application through the mmc

I'm trying to update an application in the evaluation version of Mule ESB EE.
I upload to repository, create a new deployment and start it.
But the server is still serving up the old .xml
I've tried stopping and starting the service, creating a new one with another name and whatnot but still no luck. Only thing that works is hot-deploying (drop the zip file into the directory) but that has the drawback of not showing up in the mmc.
Checking the Mulesoft forums yields one similar question that was posted 8 months ago (around october 2012) with no resolution.
Has anyone here run into this and knows of a fix?
Edit
I figured out a workaround:
When exporting the project in Mule Studio, instead of "Publish to Application Repository" select "Mule Studio Project to Mule......" (the zip file)
Using the mmc interface go to deployments tab, select repository and create new.
Import the .zip file you just created and deploy as usual.
(Also added this answer to the Mulesoft forum question)
I guess the workaround is all there is so I'm marking this as solved with that as the solution
Workaround:
When exporting the project in Mule Studio, instead of "Publish to Application Repository" select "Mule Studio Project to Mule......" (the zip file)
Using the mmc interface go to deployments tab, select repository and create new.
Import the .zip file you just created and deploy as usual.