Error CS0234 The type or namespace name 'Budget_Done2_Msg' does not exist in the namespace 'FirstCWeb' (are you missing an assemb - visual-studio-2022

When I create a new form in C# I get the following error:
I am getting error Error CS0234 The type or namespace name 'Budget_Done2_Msg' does not exist in the namespace 'FirstCWeb' (are you missing an assembly reference?) 76_Budget_Done2_Msg.aspx C:\Users\edben\OneDrive\Desktop\Projects\MyFirstCWeb_Solution\FirstCWeb\Budget_Done2_Msg.aspx 1 Active
What must I do to create new form without getting this error?
I get this after I create a new form in C# using VS 2022.

Related

My Helpers.vbhtml file results in "Type 'ASP.global_asax' is not defined"

I created the ASP.NET special folder called App_Code in my MVC project. I added a new file Helpers.vbhtml that will contain repeatedly-used razor code snippets.
Helpers.vbhtml
#Helper GetTime()
#DateTime.Now
End Helper
But this results in the error Type 'ASP.global_asax' is not defined. (x2)
Nothing seems to be affected - the application still compiles and runs. What's this error mean?
This error is caused by a naming conflict; there is a namespace called System.Web.Helpers.
The problem appears to be VB.NET-specific. I can't reproduce the problem in C#.
Rename the .vbhtml file to Snippets.vbhtml or something else that won't cause a naming conflict.

Errors running Google API calendar example for vb.net

When I try to run this example in VBExpress 2010, I get the following intellisense errors.
scopes.Add(CalendarService.Scopes.Calendar.GetStringValue())
This line generates:
Error 7 Overload resolution failed because no accessible
'GetStringValue' is most specific for these arguments:
Extension method 'Public Function GetStringValue() As String' defined in 'Google.Apis.Util.Utilities': Not most specific.
Extension method 'Public Function GetStringValue() As String' defined in 'Google.Apis.Util.Utilities': Not most specific.
Additionally, these two lines each generate a "not defined" error.
Dim credentials As FullClientCredentials = promptingClientCredentials.EnsureFullClientCredentials()
Dim initializer As New BaseClientService.Initializer()
Error 9 Type 'BaseClientService.Initializer' is not defined.
Error 8 Type 'FullClientCredentials' is not defined.
Finally, this line:
Dim state As IAuthorizationState = AuthorizationMgr.GetCachedRefreshToken(STORAGE, KEY)
generates the error:
Error 15 'AuthorizationMgr' is not declared. It may be inaccessible
due to its protection level.
As to the first error, both google.apis.silverlight.google.apis.util.utilities and google.apis.google.apis.util.utilities has a GetStringValue(system.enum) as String method.
Any ideas about any of these errors?
UPDATE: Excluding Silverlight dll seems to resolve first error ("Not most specific")
We just published a new sample using VB.NET and OAuth2.
It works in VS Professional 2012. Take a look - http://samples.google-api-dotnet-client.googlecode.com/hg/Calendar.VB.ConsoleApp/README.html

Ektron Dll for Ektron.Dxh.Common

Which all Dlls are required for using the namespace Ektron.DxH.Common in Ektron.When I used Ektron.DxH.Common it showed an error saying
"The type or namespace name 'Common' does not exist in the namespace 'Ektron.DxH' (are you missing an assembly reference?)
Any one please reply
Thanks,
You need the ContextBus DLLs. Namely:
ContextBus.Common
ContextBus.Logger

Use a C++/CLI DLL using afxwinforms.h as Reference of another C++/CLI DLL also using afxwinforms.h

In Visual C++ 2010 i added a reference from a C++/CLI DLL (ControlWrapper.dll) to another C++/CLI DLL (CliLibrary.dll).
Both are including afxwinforms.h in the stdafx.h.
When i try to compile i get these errors:
error C2011: 'Microsoft::VisualC::MFC::CWin32Window' : 'class' type redefinition
error C2011: 'Microsoft::VisualC::MFC::CWinFormsEventsHelper' : 'class' type redefinition
If i turn of the Option Reference Assembly Output and add #using "CliLibrary.dll" to the using .cpp File i get the following warnings:
1>ControlWrapper.dll : warning C4944: 'CWin32Window' : cannot import symbol from 'c:\dev\trunk\CliLibrary.dll': as 'Microsoft::VisualC::MFC::CWin32Window' already exists in the current scope
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwinforms.h(83) : see declaration of 'Microsoft::VisualC::MFC::CWin32Window'
1> This diagnostic occurred while importing type 'Microsoft.VisualC.MFC.CWin32Window' from assembly 'CliLibrary, Version=1.0.4843.17337, Culture=neutral, PublicKeyToken=null'.
1>ControlWrapper.dll : warning C4944: 'CWinFormsEventsHelper' : cannot import symbol from 'c:\dev\sfirm\trunk\sfclrlib\debug\sfclrlib.dll': as 'Microsoft::VisualC::MFC::CWinFormsEventsHelper' already exists in the current scope
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwinforms.h(122) : see declaration of 'Microsoft::VisualC::MFC::CWinFormsEventsHelper'
1> This diagnostic occurred while importing type 'Microsoft.VisualC.MFC.CWinFormsEventsHelper' from assembly 'CliLibrary, Version=1.0.4843.17337, Culture=neutral, PublicKeyToken=null'.
How could i solve the error?
Well, this is a painful problem. It certainly explains why you are the first programmer I ever encountered that actually uses this. The problem is caused by this declaration in afxwinforms.h:
public ref class CWin32Window : public System::Windows::Forms::IWin32Window
// etc..
The public keyword is the killer, that adds the class to the manifest of your assembly. So when you reference it in another project that also includes the header then there are two definitions of the class. The mix of both native and managed classes in that header prevents a clean solution.
I think you already found the best solution, using the #include, with #pragma comment(disable:4944) to shutup the compiler. Including the header inside a namespace might be another viable hack, it renames the namespace of CWin32Window, but I'd expect trouble when linking mfcm90.lib. Restructuring your solution and keeping all winforms code inside one project is the only thing I can recommend.
Are you using the types in afxwinforms.h?
If not (like in my case), the solution is to comment the include and add this two lines:
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
or add a reference to that two assemblies in your Project.

Failed to generte code for the Service reference + WCF

I am getting the following error :
Error 1 Reference.svcmap: Failed to generate code for the service reference 'ServiceReference'. Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter Error: Referenced type 'KWI.CLUE.Auto.DataContracts.CLUEResult, KWI.CLUE.Auto.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' with data contract name 'CLUEResult' in namespace 'http://schemas.datacontract.org/2004/07/KWI.CLUE.Auto.DataContracts' cannot be used since it does not match imported DataContract. Need to exclude this type from referenced types.
In order to resolve this issue : In the Configure Service Reference, clicked the Advanced button. Then chose "Reuse types in specified referenced assemblies". And unchecked KWI.CLUE.Auto.Contracts.
Now it works fine but when I am trying to access the client as below :
ServiceReference.CPServiceClient clueProcessingClient = new ServiceReference.CPServiceClient();
I am not able to see the methods of KWI.CLUE.Auto.Contracts. which is the correct behaviour.
Now is there another way to resolve this issue other than what I did.
Thanks in advance
BB