I downloaded the SocialBootstrapApi from GitHub but I can't run the example.
When I try to run it I get:
Severity Code Description Project File Line Suppression State Error CS0234
The type or namespace name 'Helpers' does not exist in the namespace 'System.Web'
(are you missing an assembly reference?) SocialBootstrapApi
Severity Code Description Project File Line Suppression State Error CS0234
The type or namespace name 'Mvc' does not exist in the namespace 'System.Web'
(are you missing an assembly reference?) SocialBootstrapApi
When I look at the Global.asax.cs file it looks like it's missing s reference to System.Web.Mvc. Nuget shows it as being installed. I tried installing several versions of MVC, still won't compile.
The read me file said to add:
<add namespace="ServiceStack.Mvc" />
to the web.config file, which I did, but it still won't compile.
Any idea what I'm doing wrong?
-Eric
The System.Web.Helpers namespace was left over from its original MVC 3 template which used to be automatically installed by older versions of VS.NET in your GAC and can be installed using Web Platform Installer.
But SocialBootstrapApi doesn't need these namespaces so I've just removed them in this commit. You should be able to pull the latest version of SocialBootstrapApi or just delete the namespaces manually. Otherwise installing MVC 3 will also work.
Related
I just created an azure pipeline from bitbucket cloud and using the default generated yaml file, when i run the Run New pipeline, I am getting errors in VsBuild saying
Error CS0246: The type or namespace name 'RestSharp' could not be found (are you missing a using directive or an assembly reference?)
The RestSharp.dll is located in my bin folder in asp.net website.
Looking at the raw logs, it says
2020-07-10T03:35:57.7771564Z Considered "d:\a\1\s\mywebsite\Bin\RestSharp.dll", but it didn't exist.
2020-07-10T03:35:57.7772002Z For SearchPath "{TargetFrameworkDirectory}".
2020-07-10T03:35:57.7772374Z Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\RestSharp.winmd", but it didn't exist.
2020-07-10T03:35:57.7772874Z Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\RestSharp.dll", but it didn't exist.
...
However, when I build in VS 2019, there are no build errors, since I am referencing my dlls and binaries.
How do I fix this missing dlls or referenced binaries? If I need to copy files from bin folder to the build directory, how?
Error CS0246: The type or namespace name 'RestSharp' could not be found
Tested using .dll file path in bin folder as HintPath. I encountered the same issue.
It seems that the root cause of this issue is that the RestSharp.dll doesn't exist in the Bin folder at the time of reference.
This is my solution to solve this issue:
Step1: Add the package reference in Packages.config file.
For example:
<?xml version="1.0" encoding="utf-8"?>
<packages>
.....
<package id="RestSharp" version="106.11.4" targetFramework="net472" />
</packages>
Step2: Change the RestSharp HintPath in .csproj file. Since you add the package reference, you could directly get the RestSharp.dll in the package path.
For example:
<Reference Include="RestSharp">
<Private>True</Private>
<HintPath>..\packages\RestSharp.106.11.4\lib\net452\RestSharp.dll</HintPath>
</Reference>
Then the RestSharp.dll could be used in the build.
By the way, I recommend that you could turn them into packages, and restore them during build. Then you could get the dll files in the package path. This can avoid the error above.
Missing references upgrading to Webjob V3
Installed the references
'IWebJobsBuilder' does not contain a definition for 'AddTimers' and no accessible extension method 'AddTimers' accepting a first argument of type 'IWebJobsBuilder' could be found (are you missing a using directive or an assembly reference?)
Using NuGet package Manager, install Microsoft.Azure.WebJobs.Extensions and Microsoft.Azure.WebJobs.Extensions.Storage packages.
The solution was to remove the references
clean the project
delete bin and obj folder
add the references again
When I run "Inspect > Code Issues in Solution", R# tells me "Cannot resolve assembly System.Drawing" and points to this line of xml in a *.resx file:
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
I looked at my System.Drawing assembly in my project's list of References. It is version 3.5.0.0, not 2.0.0.0, so I changed the version number in the xaml in the .resx file from 2.0 to 3.5. That still elicited the same warning from R#, though.
So then I thought maybe it was the PublicKeyToken that was the culprit; so I changed that value from "b03f5f7f11d50a3a" to "969db8053d3322ac" (as found here); but then the project wouldn't even build; I got:
Invalid Resx file. The located assembly's manifest definition does not match the assembly reference.
Although these "issues" exist, the app seems to be working okay - the image that follows the assembly alias:
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
blee blah bloo
</value>
</data>
...displays fine.
Still, when R# raises its finger, it makes me nervous; how can I rectify this flubup?
NOTE: This is a Visual Studio 2008 Windows CE/Compact Framework app.
I had a similar problem in the resx file in one of my C# projects:
Once I installed the relevant reference (System.Windows.Forms etc) - for that project - that particular resharper issue went away:
After adding SFML.NET through Nuget Packge manager I got the following error:
Error 4 The "UnzipNuspec" task was not found. Check the following: 1.) The name of the
task in the project file is the same as the name of the task class. 2.) The task class is
"public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is
correctly declared with <UsingTask> in the project file, or in the *.tasks files located
in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
I'm using Visual Studio 2012.
As pointed out in other similar questions, I've tried to close and open MSVS, it didn't helped.
I also checked out the build tools path in the registry, and it points to right directory.
I tried to install and uninstall Nuget packeage.
I found out that error possibly somehow connected to it's dependency : Baseclass.Contrib.Nuget.Output, but I can't find out how to fix it.
It's a bug in their build script.
Go to the packages folder for your solution and locate the following file:
Baseclass.Contrib.Nuget.Output.1.0.6\build\net40\Baseclass.Contrib.Nuget.Output.targets
Around line 84 in that file you'll find a couple of <Using Namespace=... /> tags. Add this after those, before the <Code...> tag:
<Using Namespace="System.Threading" />
I've reported this on their github issues list as well.
I'm having difficulty implementing EFCodeFirst.CreateTablesOnly (changed to DontDropDbJustCreateTablesIfModelChangedStart).
I have successfully pulled in the package using NUGET. Now there is a mention of
in packages.config
and a DontDropDbJustCreateTablesIfModelChangedStart.cs
I've added Devtalk.EF.CodeFirst to references
in my app_start directory.
But I still can't make use of the DontDropDbJustCreateTablesIfModelChangedStart class. When I do, the app dies with msg
Could not load file or assembly 'EntityFramework, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
When I check definition of DontDropDbJustCreateTablesIfModelChangedStart, I find it only has a signature and not a definition.
What did I do wrong? Or what step did I leave out? Am I supposed to Implement the Class/Method?
The problem is that library was probably compiled with EntityFramework.dll version 4.1.0.0 and author didn't update it for version 4.2.0.0 and 4.3.0.0. Try to redirect version 4.1.0.0 to version 4.3.0.0 in your web.config file.
Don't Use it use EF's Migrations:
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-released.aspx