Global.Micrsoft.VisualBasic.ApplicationsServices... is not defined error BC30002 - vb.net

I'm converting some old legacy VB apps from .NET framework to .NET 5, and have worked through most of the issues, however, I'm lost on these:
Error BC30002 Type 'Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase' is not defined.
Error BC30002 Type 'Global.Microsoft.VisualBasic.ApplicationServices.User' is not defined.
Error BC30002 Type 'Global.Microsoft.VisualBasic.Devices.Computer' is not defined.
Error BC30002 Type 'Global.Microsoft.VisualBasic.MyServices.Internal.ContextValue' is not defined.
VisualBasic 10.3.0 package is included in the project.
Any tips are appreciated.
Thanks,
Bill

I came accross the same issue today trying to update a .net framework (4.6 but I guess it applies to 4.x generally) to .net 5 using Microsofts Upgrade assistent.
I found the solution in this bug report on github:
Simply put, add the following to your newly created .vbproj-file:
<PropertyGroup>
<MyType>Empty</MyType>
</PropertyGroup>
Place at the end of of .vbproj-file just before </Project> end tag.

Related

ASP.NET Core configurations issue with rc1 vs rc2 and more

I am using the DotNetCore.1.0.0-VS2015Tools.Preview2.exe with Visual Studio Update 3.
I am unable to migrate code to read settings in the appsettings.json file from an MVC6 app.
The code uses the #inject Microsoft.Extensions.OptionsModel.IOptions Settings syntax in a razor file to read the configuration.
The only version of Microsoft.Extensions.OptionsModel.IOptions available is rc1, whereas the Microsoft.Extensions.Options.ConfigurationExtensions version is rc2.
Therefore I am getting the 'ambiguous call' error referred to in a related .net github issue:
Error CS0121 The call is ambiguous between the following methods or properties:
Microsoft.Extensions.DependencyInjection.OptionsServiceCollectionExtensions.Configure and Microsoft.Extensions.DependencyInjection.OptionsConfigurationServiceCollectionExtensions.Configure. This error is about using ANY rc1 version concurrently with any rc2 version of any library/component listed in project.json.
leaving out the Microsoft.Extensions.OptionsModel.Options part I get this further error:
Could not load type 'Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions' from assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Of course, I realize this is part of the worst (or most visible) release mess in ms-land history. And such is the cost of progress. But I still would like to know the answer, please.

Field not found: 'Nancy.Bootstrapper.NancyBootstrapperLocator.Bootstrapper'

i recently have been using Nancy fx and i'm in love with it, but when i try to make a structuremap ioc like the documentation page suggested i get the error
Field not found: 'Nancy.Bootstrapper.NancyBootstrapperLocator.Bootstrapper'.
i have override the getApplicationContainer function like shown in the file
https://github.com/CarlosBolanos/apadrina/blob/master/Application/Bootstrapper.cs
but still get the same error, i look on the code on the rnancy repository
https://github.com/NancyFx/Nancy.Bootstrappers.StructureMap/blob/master/src/Nancy.Bootstrappers.StructureMap/StructureMapNancyBootstrapper.cs
and i cant see the bootstrapper property
does any1 else have this error too i've been trying to set this up for hours,
if i remove the nancystructuremap in nugget the error goes away.
or do i need to set something else on the bootstrap class.
I ran into this scenario after installing Nancy.Bootstrappers.Ninject from Nuget. My Nancy project was created using the Nancy Visual Studio templates, and were referencing Nancy 0.21.1.
What I found was installing the bootstrapper package caused the base Nancy package to get upgraded from 0.21.1 to 0.23.2. This is fine, except that the Nancy.Hosting.Aspnet and the Razor engine packages were NOT upgraded from 0.21.1.
To fix the error, I had to update all of the Nancy-related packages I was using to match the 0.23.2 package.

I cannot add service reference(WCF library) to MVC4 in VS2012

My problem is very simple, but unfortunately I cannot figure out what's wrong. I've created a new MVC4 Internet Application project with Razor syntax, then I added another WCF Library project to this solution. I did not make any change on these codes. However, as I added the WCF project as a service reference in the MVC 4 app, I'm getting 1 Error message and 3 Warning messages:
Error 4 Custom tool error: Failed to generate code for the service
reference 'ServiceReference1'. Please check other error and warning
messages for details. c:\users\vendre\documents\visual studio
2012\Projects\MvcApplication3\MvcApplication3\Service
References\ServiceReference1\Reference.svcmap 1 1 MvcApplication3
Warning 1 Custom tool warning: Cannot import wsdl:portType Detail:
An exception was thrown while running a WSDL import extension:
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Could not load file or assembly 'DotNetOpenAuth.AspNet,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246'
or one of its dependencies. The system cannot find the file
specified.
Warning 2 Custom tool warning: Cannot import wsdl:binding Detail:
There was an error importing a wsdl:portType that the wsdl:binding
is dependent on. XPath to wsdl:portType:
//wsdl:definitions[#targetNamespace='http://tempuri.org/']/wsdl:portType[#name='IService1']
Warning 3 Custom tool warning: Cannot import wsdl:port Detail: There
was an error importing a wsdl:binding that the wsdl:port is
dependent on. XPath to wsdl:binding:
//wsdl:definitions[#targetNamespace='http://tempuri.org/']/wsdl:binding[#name='BasicHttpBinding_IService1']
I read some article but did not resolved my problem. If somebody know the answer for my problem, please tell me.
THX.
When you add the reference, on advanced setting remove the reuse types checkbox.
If you're experiencing this problem in 2021 with VS2019. Add a folder to the project called "Connected Services"
sometimes you need to create a folder "Service References" in project path. If you dont have this folder it should gives this path error.
If using VS 2019, check if in Solution Explorer you see "Service Reference". Than edit the project file for following
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
In Visual Studio 2019, I fixed the error (system cannot find path specified) by creating a new folder named "Connected Services" inside project folder
In Visual Studio 2022, You need to create a folder "Connected Services" in project path, via Windows Explorer, not Visual studio solution explorer'
You can try the following :
Delete the "Connected Services" folder from the project in Visual Studio
Add the service reference with right-click on the project / Add / Service Reference...
It should work and recreate the "Connected Services" folder with your new service reference.

Reflexil deobfustication error

I'm trying to modify a .net application and I'm new to this. First step is attempting to deobfuscate the code using reflexil and I get the following error:
Reflexil is unable to clean this assembly: Member 'System.RuntimeTypeHandle "bunch of obfustatcated jibberish"(System.Int32)' is declared in another module and needs to be imported
The application comes with a bunch of dll's that it certainly uses, so I assume the declaration is in one of those files. How do I import this module?
In case it's helpful, reflexil says it was obfuscated with .NET Reactor 4.1
I decided to try de4not to deobfuscate and it worked without this issue.

Installing RelationExtensions for petapoco firing error

I have installed petapoco RelationExtensions from NUGET and it`s firing error message:
Error 4 The type or namespace name 'IDatabase' could not be found (are you missing a using directive or an assembly reference?) C:\Users\testkit\Models\PetaPocoRelationExtensions.cs 13
Is there the need to dowload any other files?
How can I correct the error?
If you change the IDatabase references to Database references this will work correctly. Nuget has been updated to fix this in 1.0.2.
The IDatabase interface is available on my branch at http://github.com/schotime/petapoco along with extra features, like Fluent Mapping.